diff options
author | Ignacio Burgue o <ignaciob@inconcertcc.com> | 2015-06-17 09:54:07 -0300 |
---|---|---|
committer | Ignacio BurgueƱo <ignaciob@inconcertcc.com> | 2015-06-25 12:47:01 -0300 |
commit | b3a4e889dc3f06e83a299096710406920f18cd51 (patch) | |
tree | 66a5ad4c9db3303edbfc5f79ea3b42942f2ea283 | |
parent | f61e5a22d7d76561cfb10a8d83e14e324d2a772a (diff) | |
download | luarocks-b3a4e889dc3f06e83a299096710406920f18cd51.tar.gz luarocks-b3a4e889dc3f06e83a299096710406920f18cd51.tar.bz2 luarocks-b3a4e889dc3f06e83a299096710406920f18cd51.zip |
CMake needs a hint to use 64 bit target with msvc.
Only when using Windows 64 bits and the msvc compiler. CMake
uses the x86 generator by default. We need to tell it explicitly
that we wan't to use the x64 generator.
refs #382
-rw-r--r-- | src/luarocks/build/cmake.lua | 14 |
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 |