aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/luarocks/build/cmake.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/luarocks/build/cmake.lua b/src/luarocks/build/cmake.lua
index c8f5a669..7b16fa51 100644
--- a/src/luarocks/build/cmake.lua
+++ b/src/luarocks/build/cmake.lua
@@ -35,14 +35,18 @@ function cmake.run(rockspec)
35 cmake_handler:close() 35 cmake_handler:close()
36 end 36 end
37 37
38
39 -- Execute cmake with variables. 38 -- Execute cmake with variables.
40 local args = "" 39 local args = ""
40
41 -- Try to pick the best generator. With msvc and x64, CMake does not select it by default so we need to be explicit.
41 if cfg.cmake_generator then 42 if cfg.cmake_generator then
42 args = args .. ' -G"'..cfg.cmake_generator.. '"' 43 args = args .. ' -G"'..cfg.cmake_generator.. '"'
44 elseif cfg.is_platform("windows") and cfg.target_cpu:match("x86_64$") then
45 args = args .. " -DCMAKE_GENERATOR_PLATFORM=x64"
43 end 46 end
47
44 for k,v in pairs(variables) do 48 for k,v in pairs(variables) do
45 args = args .. ' -D' ..k.. '="' ..v.. '"' 49 args = args .. ' -D' ..k.. '="' ..tostring(v).. '"'
46 end 50 end
47 51
48 if not fs.execute_string(rockspec.variables.CMAKE.." -H. -Bbuild.luarocks "..args) then 52 if not fs.execute_string(rockspec.variables.CMAKE.." -H. -Bbuild.luarocks "..args) then