diff options
| author | Ignacio Burgueño <iburgueno@gmail.com> | 2015-06-25 12:54:17 -0300 |
|---|---|---|
| committer | Ignacio Burgueño <iburgueno@gmail.com> | 2015-06-25 12:54:17 -0300 |
| commit | 030dda2bac1b3997616dc505fbaac5d24bcacc20 (patch) | |
| tree | 23286d694869394ca4b5244462d5ceb169c9c6e0 | |
| parent | 028b37f2376225aa69c946beb44fd7dd68f32604 (diff) | |
| parent | 79ffabfb806ff608db0cb9356627c61889b73284 (diff) | |
| download | luarocks-030dda2bac1b3997616dc505fbaac5d24bcacc20.tar.gz luarocks-030dda2bac1b3997616dc505fbaac5d24bcacc20.tar.bz2 luarocks-030dda2bac1b3997616dc505fbaac5d24bcacc20.zip | |
Merge pull request #383 from ignacio/cmake_64
cmake backend: Generate 64 bits build when appropiate
| -rw-r--r-- | src/luarocks/build/cmake.lua | 8 |
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 |
