Browse Source

Fix Lua cmake() so it works when CMake is in PATH on macOS.

pull/1504/head
Joao Matos 6 years ago
parent
commit
78716eecf9
  1. 11
      build/scripts/LLVM.lua

11
build/scripts/LLVM.lua

@ -214,15 +214,20 @@ end
function cmake(gen, conf, builddir, options) function cmake(gen, conf, builddir, options)
local cwd = os.getcwd() local cwd = os.getcwd()
os.chdir(builddir) os.chdir(builddir)
local cmake = os.ishost("macosx") and "/Applications/CMake.app/Contents/bin/cmake"
or "cmake" local cmake = "cmake"
result, error = os.outputof(cmake)
local found = error ~= 127 -- command not found
if not found and os.ishost("macosx") then
local cmake = "/Applications/CMake.app/Contents/bin/cmake"
end
if options == nil then if options == nil then
options = "" options = ""
end end
if UseClang() then if UseClang() then
local cmake = path.join(basedir, "scripts", "ClangToolset.cmake")
options = options .. " -DLLVM_USE_LINKER=/usr/bin/ld.lld" options = options .. " -DLLVM_USE_LINKER=/usr/bin/ld.lld"
end end

Loading…
Cancel
Save