Changeset View
Standalone View
build/premake/premake5.lua
Show First 20 Lines • Show All 103 Lines • ▼ Show 20 Lines | if os.istarget("bsd") then | ||||
link_execinfo = true | link_execinfo = true | ||||
elseif os.istarget("linux") then | elseif os.istarget("linux") then | ||||
local _, link_errorCode = os.outputof(cc .. " ./tests/execinfo.c -o /dev/null") | local _, link_errorCode = os.outputof(cc .. " ./tests/execinfo.c -o /dev/null") | ||||
if link_errorCode ~= 0 then | if link_errorCode ~= 0 then | ||||
link_execinfo = true | link_execinfo = true | ||||
end | end | ||||
end | end | ||||
-- Test whether we need to link libatomic in clang | |||||
local link_atomic = false | |||||
if os.istarget("linux") and cc == "clang" then | |||||
os.execute(cc .. " -o atomic2.o -c ./tests/atomic2.cpp") | |||||
os.execute(cc .. " -o atomic1.o -c ./tests/atomic1.cpp") | |||||
local _, atomic_rc1 = os.outputof(cc .. " -o /dev/null -lstdc++ atomic1.o atomic2.o") | |||||
local _, atomic_rc2 = os.outputof(cc .. " -o /dev/null -lstdc++ -latomic atomic1.o atomic2.o") | |||||
vladislavbelov: Why `boost` is not linked? Also is it guaranteed that it's installed to that point? | |||||
Done Inline Actions
boost::lockfree::queue<bool> queue(128); clang++ -MMD -MP -DNDEBUG -DCONFIG_FINAL=1 -DCONFIG2_AUDIO=0 -DCONFIG2_LOBBY=0 -DCONFIG2_MINIUPNPC=0 -DLIB_STATIC_LINK -DCONFIG_ENABLE_PCH=1 -I../../../source/pch/network -I../../../source -isystem ../../../libraries/source/spidermonkey/include-unix-release -isystem /usr/include/SDL2 -O3 -g -Wall -Wextra -fno-rtti -std=c++17 -Wno-switch -Wno-reorder -Wno-invalid-offsetof -Wextra -Wno-missing-field-initializers -Wunused-parameter -Wredundant-decls -Wnon-virtual-dtor -Wundef -fstack-protector-all -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstrict-aliasing -fno-omit-frame-pointer -fpch-preprocess -fPIC -march=pentium3 -mtune=generic -fvisibility=hidden -D_REENTRANT -include obj/network_Release/precompiled.h -o "obj/network_Release/NetSession.o" -MF "obj/network_Release/NetSession.d" -c "../../../source/network/NetSession.cpp"
I'll test it. Perhaps the screen will be full of errors nwtour: >Why boost is not linked?
boost::lockfree::queue<bool> queue(128);
It is not a call to the… | |||||
Not Done Inline Actions
Technically it calls the queue constructor, which is also a function. And the question "is it header-only or not" is its implementation detail. vladislavbelov: > boost::lockfree::queue<bool> queue(128);
> It is not a call to the boost function and does… | |||||
Done Inline Actions
queue this is the name of the variable. I can change on boost::lockfree::queue<bool> testtest(128);
Code from extern_libs5.lua: unix_names = { os.findlib("boost_filesystem-mt") and "boost_filesystem-mt" or "boost_filesystem", os.findlib("boost_system-mt") and "boost_system-mt" or "boost_system" } It is strange to add it for still non-existent functionality of boost::lockfile::queue nwtour: > Technically it calls the `queue` constructor, which is also a function.
queue this is the… | |||||
Not Done Inline Actions
The name doesn't matter. The constructor will be called anyway.
I only need guarantees that it won't be false positive. I suppose https://www.boost.org/doc/libs/1_76_0/more/getting_started/windows.html#header-only-libraries should be a guarantee. vladislavbelov: > queue this is the name of the variable. I can change on
The name doesn't matter. The… | |||||
Done Inline Actions
I could be wrong, but the constructor is what is called to create the first instance. If this behavior is scary, I can add a link to boost nwtour: > > queue this is the name of the variable. I can change on
> The name doesn't matter. The… | |||||
Not Done Inline Actions
In the boost::lockfree::queue<bool> queue(128); line you've already created the first instance (and you passed 128 to the constructor). vladislavbelov: > I could be wrong, but the constructor is what is called to create the first instance.
In the… | |||||
Done Inline Actions
Sorry, my bad. In theory, the task was just to scare the compiler and do not call code from the boost. nwtour: > > I could be wrong, but the constructor is what is called to create the first instance.
>
>… | |||||
Done Inline Actions
Must not be: nwtour: > I only need guarantees that it won't be false positive.
Must not be:
os.outputof - With any… | |||||
if atomic_rc1 ~= 0 and atomic_rc2 == 0 then | |||||
link_atomic = true | |||||
end | |||||
os.execute("rm atomic1.o atomic2.o") | |||||
end | |||||
-- Set up the Workspace | -- Set up the Workspace | ||||
workspace "pyrogenesis" | workspace "pyrogenesis" | ||||
targetdir(rootdir.."/binaries/system") | targetdir(rootdir.."/binaries/system") | ||||
libdirs(rootdir.."/binaries/system") | libdirs(rootdir.."/binaries/system") | ||||
if not _OPTIONS["outpath"] then | if not _OPTIONS["outpath"] then | ||||
error("You must specify the 'outpath' parameter") | error("You must specify the 'outpath' parameter") | ||||
end | end | ||||
location(_OPTIONS["outpath"]) | location(_OPTIONS["outpath"]) | ||||
▲ Show 20 Lines • Show All 934 Lines • ▼ Show 20 Lines | elseif os.istarget("linux") or os.istarget("bsd") then | ||||
end | end | ||||
if link_execinfo then | if link_execinfo then | ||||
links { | links { | ||||
"execinfo" | "execinfo" | ||||
} | } | ||||
end | end | ||||
if link_atomic then | |||||
links { | |||||
"atomic" | |||||
} | |||||
end | |||||
if os.istarget("linux") or os.getversion().description == "GNU/kFreeBSD" then | if os.istarget("linux") or os.getversion().description == "GNU/kFreeBSD" then | ||||
links { | links { | ||||
-- Dynamic libraries (needed for linking for gold) | -- Dynamic libraries (needed for linking for gold) | ||||
"dl", | "dl", | ||||
} | } | ||||
end | end | ||||
-- Threading support | -- Threading support | ||||
▲ Show 20 Lines • Show All 407 Lines • Show Last 20 Lines |
Why boost is not linked? Also is it guaranteed that it's installed to that point?