Change to enable build by Ninja on Windows

This commit is contained in:
erw7 2018-05-21 19:32:19 +09:00
parent 35cc15e157
commit 828c9baad2
3 changed files with 22 additions and 4 deletions

View File

@ -81,6 +81,15 @@ if(CMAKE_GENERATOR MATCHES "Makefiles")
set(MAKE_PRG "$(MAKE)")
endif()
if(MINGW AND CMAKE_GENERATOR MATCHES "Ninja")
find_program(MAKE_PRG NAMES mingw32-make)
if(NOT MAKE_PRG)
message(FATAL_ERROR "GNU Make for mingw32 is required to build the dependecies.")
else()
message(STATUS "Found GNU Make for mingw32 at ${MAKE_PRG}")
endif()
endif()
if(CMAKE_C_COMPILER_ARG1)
set(DEPS_C_COMPILER "${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1}")
else()

View File

@ -66,10 +66,15 @@ elseif(MINGW AND CMAKE_CROSSCOMPILING)
elseif(MINGW)
if(CMAKE_GENERATOR MATCHES "Ninja")
set(LIBUV_MAKE_PRG ${MAKE_PRG})
else()
set(LIBUV_MAKE_PRG ${CMAKE_MAKE_PROGRAM})
endif()
# Native MinGW
BuildLibUv(BUILD_IN_SOURCE
PATCH_COMMAND ${LIBUV_PATCH_COMMAND}
BUILD_COMMAND ${CMAKE_MAKE_PROGRAM} -f Makefile.mingw
BUILD_COMMAND ${LIBUV_MAKE_PRG} -f Makefile.mingw
INSTALL_COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS_INSTALL_DIR}/lib
COMMAND ${CMAKE_COMMAND} -E copy ${DEPS_BUILD_DIR}/src/libuv/libuv.a ${DEPS_INSTALL_DIR}/lib
COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS_INSTALL_DIR}/include

View File

@ -78,8 +78,12 @@ elseif(MINGW AND CMAKE_CROSSCOMPILING)
elseif(MINGW)
BuildLuaJit(BUILD_COMMAND ${CMAKE_MAKE_PROGRAM} CC=${DEPS_C_COMPILER}
if(CMAKE_GENERATOR MATCHES "Ninja")
set(LUAJIT_MAKE_PRG ${MAKE_PRG})
else()
set(LUAJIT_MAKE_PRG ${CMAKE_MAKE_PROGRAM})
endif()
BuildLuaJit(BUILD_COMMAND ${LUAJIT_MAKE_PRG} CC=${DEPS_C_COMPILER}
PREFIX=${DEPS_INSTALL_DIR}
CFLAGS+=-DLUAJIT_DISABLE_JIT
CFLAGS+=-DLUA_USE_APICHECK
@ -87,7 +91,7 @@ elseif(MINGW)
CCDEBUG+=-g
BUILDMODE=static
# Build a DLL too
COMMAND ${CMAKE_MAKE_PROGRAM} CC=${DEPS_C_COMPILER} BUILDMODE=dynamic
COMMAND ${LUAJIT_MAKE_PRG} CC=${DEPS_C_COMPILER} BUILDMODE=dynamic
INSTALL_COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS_INSTALL_DIR}/bin
COMMAND ${CMAKE_COMMAND} -E copy ${DEPS_BUILD_DIR}/src/luajit/src/luajit.exe ${DEPS_INSTALL_DIR}/bin