aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/luarocks/build/cmake.lua14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/luarocks/build/cmake.lua b/src/luarocks/build/cmake.lua
index a1c08dfa..3d0f22a2 100644
--- a/src/luarocks/build/cmake.lua
+++ b/src/luarocks/build/cmake.lua
@@ -37,16 +37,16 @@ function cmake.run(rockspec)
37 37
38 -- Execute cmake with variables. 38 -- Execute cmake with variables.
39 local args = "" 39 local args = ""
40 if cfg.cmake_generator then 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.
42 if cfg.is_platform("mingw32") and cfg.cmake_generator then
41 args = args .. ' -G"'..cfg.cmake_generator.. '"' 43 args = args .. ' -G"'..cfg.cmake_generator.. '"'
42 end 44 elseif cfg.is_platform("windows") and cfg.arch:match("%-x86_64$") then
43 for k,v in pairs(variables) do 45 args = args .. " -DCMAKE_GENERATOR_PLATFORM=x64"
44 args = args .. ' -D' ..k.. '="' ..v.. '"'
45 end 46 end
46 47
47 -- Generate 64 bit build if appropiate. 48 for k,v in pairs(variables) do
48 if not not cfg.arch:match("%-x86_64$") then 49 args = args .. ' -D' ..k.. '="' ..tostring(v).. '"'
49 args = args .. " -DCMAKE_GENERATOR_PLATFORM=x64"
50 end 50 end
51 51
52 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