diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2021-10-09 10:40:27 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-09 10:40:27 -0400 |
| commit | ae7d58b1a559d36c602bf6b1d8e396324cc34003 (patch) | |
| tree | 0b23079d8b7b3ed37eee90084664bef64b299ed8 /premake5.lua | |
| parent | 714b7505b84cd27ad828e231da04ae6b28a2f13a (diff) | |
Small improvements for premake linking on linux (#1958)
* #include an absolute path didn't work - because paths were taken to always be relative.
* Small improvements to premake for linux around linking.
* Link with pthread of slang-glslang.
Diffstat (limited to 'premake5.lua')
| -rw-r--r-- | premake5.lua | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/premake5.lua b/premake5.lua index 450485e34..32731dd77 100644 --- a/premake5.lua +++ b/premake5.lua @@ -249,7 +249,10 @@ newoption { filter { "toolset:clang or gcc*" } - buildoptions { "-Wno-unused-parameter", "-Wno-type-limits", "-Wno-sign-compare", "-Wno-unused-variable", "-Wno-reorder", "-Wno-switch", "-Wno-return-type", "-Wno-unused-local-typedefs", "-Wno-parentheses", "-fvisibility=hidden" , "-Wno-ignored-optimization-argument", "-Wno-unknown-warning-option", "-Wno-class-memaccess"} + -- Makes all symbols hidden by default unless explicitly 'exported' + buildoptions { "-fvisibility=hidden" } + -- Warnings + buildoptions { "-Wno-unused-parameter", "-Wno-type-limits", "-Wno-sign-compare", "-Wno-unused-variable", "-Wno-reorder", "-Wno-switch", "-Wno-return-type", "-Wno-unused-local-typedefs", "-Wno-parentheses", "-Wno-ignored-optimization-argument", "-Wno-unknown-warning-option", "-Wno-class-memaccess"} filter { "toolset:gcc*"} buildoptions { "-Wno-unused-but-set-variable", "-Wno-implicit-fallthrough" } @@ -272,9 +275,15 @@ newoption { filter { "configurations:release" } optimize "On" defines { "NDEBUG" } - + filter { "system:linux" } - linkoptions{ "-Wl,-rpath,'$$ORIGIN',--no-as-needed", "-ldl"} + links { "dl" } + -- + -- `--start-group` - allows libraries to be listed in any order (do not require dependency order) + -- `--no-undefined` - by default if a symbol is not found in a link it will assume it will be resolved at runtime (!) + -- this option ensures that all the referenced symbols exist + -- + linkoptions{ "-Wl,-rpath,'$$ORIGIN',--no-as-needed,--no-undefined,--start-group" } function dump(o) if type(o) == 'table' then @@ -1453,7 +1462,7 @@ newoption { -- don't really care about *any* of that, but we can't remove it from the -- build so we need to include the appropriate platform-specific sources. - links { "slang-spirv-tools" } + links { "slang-spirv-tools"} filter { "system:windows" } -- On Windows we need to add the platform-specific sources and then @@ -1464,9 +1473,7 @@ newoption { filter { "system:linux or macosx" } addSourceDir( "external/glslang/glslang/OSDependent/Unix") - links { "dl" } - - + links { "dl", "pthread" } -- -- With glslang's build out of the way, we've now covered everything we have |
