summaryrefslogtreecommitdiff
path: root/premake5.lua
diff options
context:
space:
mode:
authorCraig Kolb <craig.kolb@gmail.com>2022-05-31 11:16:34 -0700
committerGitHub <noreply@github.com>2022-05-31 14:16:34 -0400
commit1a83d50a5d9e85934386310c17a14860cc92e75c (patch)
tree710c74036362a3424bfe630c867f13be0455b899 /premake5.lua
parent2d3392f22c894957d17dd13486e0565c4ecea89c (diff)
Work around MacOS compilation issue with embed stlib (#2255)
- The enable-stdlib-generator project is created with 'kind = StaticLib' to allow the build to work, even though the project doesn't actually create a library. - Unlike some other platforms, MacOs "ar" emits an error if no object files are listed to be added to an archive. This causes enable-stdlib-generator to fail on MacOS. - Changing the project's kind to "SharedLib" works around the issue. Other values for kind do not seem to work around the issue. - Add an optional flag to generatorProject to indicate that kind = "SharedLibrary" should be used, rather than "StaticLibrary" - Add MacOS fix for SharedLibraryUtils::getSharedLibraryFileName(). - Enable embed stdlib in github_macos_build.sh
Diffstat (limited to 'premake5.lua')
-rw-r--r--premake5.lua12
1 files changed, 8 insertions, 4 deletions
diff --git a/premake5.lua b/premake5.lua
index d59c03f90..9b985e29d 100644
--- a/premake5.lua
+++ b/premake5.lua
@@ -628,7 +628,7 @@ newoption {
-- build items needed for other dependencies
---
- function generatorProject(name, sourcePath)
+ function generatorProject(name, sourcePath, isSharedLib)
-- We use the `group` command here to specify that the
-- next project we create shold be placed into a group
-- named "generator" in a generated IDE solution/workspace.
@@ -642,9 +642,13 @@ newoption {
-- Set up the project, but do NOT add any source files.
baseSlangProject(name, sourcePath)
- -- For now we just use static lib to force something
+ -- By default, just use static lib to force something
-- to build.
- kind "StaticLib"
+ if isSharedLib then
+ kind "SharedLib"
+ else
+ kind "StaticLib"
+ end
end
--
@@ -1222,7 +1226,7 @@ standardProject("slang-rt", "source/slang-rt")
end
if enableEmbedStdLib then
- generatorProject("embed-stdlib-generator", nil)
+ generatorProject("embed-stdlib-generator", nil, true)
-- We include these, even though they are not really part of the dummy
-- build, so that the filters below can pick up the appropriate locations.