Skip to content

Commit 1407f35

Browse files
committed
Some Premake robustness fixes for Clang toolchain.
1 parent 42fe2b5 commit 1407f35

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

build/Helpers.lua

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,10 @@ function SetupNativeProject()
151151
filter { "toolset:clang", "system:not macosx" }
152152
linkoptions { "-fuse-ld=/usr/bin/ld.lld" }
153153

154-
filter { "system:macosx", "language:C++" }
154+
filter { "toolset:clang" }
155+
buildoptions { "-fstandalone-debug" }
156+
157+
filter { "toolset:clang", "language:C++", "system:macosx" }
155158
buildoptions { gcc_buildflags, "-stdlib=libc++" }
156159
links { "c++" }
157160

@@ -238,8 +241,9 @@ function StaticLinksOpt(libnames)
238241
end
239242

240243
function UseClang()
241-
local compiler = os.getenv("CXX") or ""
242-
return string.match(compiler, "clang")
244+
local cc = _OPTIONS.cc or ""
245+
local env = os.getenv("CXX") or ""
246+
return string.match(cc, "clang") or string.match(env, "clang")
243247
end
244248

245249
function GccVersion()

0 commit comments

Comments
 (0)