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 | |
| 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.
| -rw-r--r-- | premake5.lua | 21 | ||||
| -rw-r--r-- | source/compiler-core/slang-downstream-compiler.h | 12 |
2 files changed, 20 insertions, 13 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 diff --git a/source/compiler-core/slang-downstream-compiler.h b/source/compiler-core/slang-downstream-compiler.h index ed932a5c9..1e6571e0f 100644 --- a/source/compiler-core/slang-downstream-compiler.h +++ b/source/compiler-core/slang-downstream-compiler.h @@ -67,12 +67,12 @@ struct DownstreamDiagnostic /// Given diagnostics in inText that are colon delimited, use lineParser to do per line parsing. static SlangResult parseColonDelimitedDiagnostics(const UnownedStringSlice& inText, Int pathIndex, LineParser lineParser, List<DownstreamDiagnostic>& outDiagnostics); - Severity severity; ///< The severity of error - Stage stage; ///< The stage the error came from - String text; ///< The text of the error - String code; ///< The compiler specific error code - String filePath; ///< The path the error originated from - Int fileLine; ///< The line number the error came from + Severity severity = Severity::Unknown; ///< The severity of error + Stage stage = Stage::Compile; ///< The stage the error came from + String text; ///< The text of the error + String code; ///< The compiler specific error code + String filePath; ///< The path the error originated from + Int fileLine = 0; ///< The line number the error came from }; struct DownstreamDiagnostics |
