|
@ -49,9 +49,9 @@ if(CMAKE_COMPILER_IS_GNUCC) |
|
|
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -g") |
|
|
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -g") |
|
|
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -O3") |
|
|
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -O3") |
|
|
elseif(MSVC) |
|
|
elseif(MSVC) |
|
|
set(CMAKE_CXX_FLAGS "/W3 /MP /MT") |
|
|
|
|
|
|
|
|
set(CMAKE_CXX_FLAGS "/MP /W3 /MT /GR- /GS- /D_WIN32_WINNT=0x0501 /DWINVER=0x0501") |
|
|
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS}") |
|
|
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS}") |
|
|
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} /Ox") |
|
|
|
|
|
|
|
|
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} /O2") |
|
|
endif() |
|
|
endif() |
|
|
|
|
|
|
|
|
# Set C compiler flags |
|
|
# Set C compiler flags |
|
@ -59,6 +59,12 @@ set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS}") |
|
|
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}") |
|
|
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}") |
|
|
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}") |
|
|
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}") |
|
|
|
|
|
|
|
|
|
|
|
# Set executable linker flags |
|
|
|
|
|
if(MSVC) |
|
|
|
|
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /nologo") |
|
|
|
|
|
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /OPT:REF /OPT:ICF /INCREMENTAL:NO") |
|
|
|
|
|
endif() |
|
|
|
|
|
|
|
|
# Setup module directories |
|
|
# Setup module directories |
|
|
set(MODULE_SOURCE_DIR "${PROJECT_SOURCE_DIR}/modules") |
|
|
set(MODULE_SOURCE_DIR "${PROJECT_SOURCE_DIR}/modules") |
|
|
set(MODULE_BUILD_DIR "${PROJECT_BINARY_DIR}/modules/build") |
|
|
set(MODULE_BUILD_DIR "${PROJECT_BINARY_DIR}/modules/build") |
|
@ -75,10 +81,14 @@ ExternalProject_Add(SDL2 |
|
|
CMAKE_ARGS |
|
|
CMAKE_ARGS |
|
|
"-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}" |
|
|
"-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}" |
|
|
"-DCMAKE_INSTALL_PREFIX=${MODULE_INSTALL_DIR}" |
|
|
"-DCMAKE_INSTALL_PREFIX=${MODULE_INSTALL_DIR}" |
|
|
|
|
|
"-DCMAKE_C_FLAGS='${CMAKE_C_FLAGS}'" |
|
|
|
|
|
"-DCMAKE_C_FLAGS_DEBUG='${CMAKE_C_FLAGS_DEBUG}'" |
|
|
|
|
|
"-DCMAKE_C_FLAGS_RELEASE='${CMAKE_C_FLAGS_RELEASE}'" |
|
|
"-DSDL_SHARED=OFF" |
|
|
"-DSDL_SHARED=OFF" |
|
|
"-DSDL_STATIC=ON" |
|
|
"-DSDL_STATIC=ON" |
|
|
"-DSDL_LIBC=ON" |
|
|
"-DSDL_LIBC=ON" |
|
|
"-DSDL_FORCE_STATIC_VCRT=ON" |
|
|
"-DSDL_FORCE_STATIC_VCRT=ON" |
|
|
|
|
|
"-DSDL_ASSERTIONS=disabled" |
|
|
"-DSDL_ATOMIC=OFF" |
|
|
"-DSDL_ATOMIC=OFF" |
|
|
"-DSDL_AUDIO=OFF" |
|
|
"-DSDL_AUDIO=OFF" |
|
|
"-DSDL_VIDEO=ON" |
|
|
"-DSDL_VIDEO=ON" |
|
@ -89,7 +99,7 @@ ExternalProject_Add(SDL2 |
|
|
"-DSDL_HIDAPI=ON" |
|
|
"-DSDL_HIDAPI=ON" |
|
|
"-DSDL_POWER=OFF" |
|
|
"-DSDL_POWER=OFF" |
|
|
"-DSDL_THREADS=OFF" |
|
|
"-DSDL_THREADS=OFF" |
|
|
"-DSDL_TIMERS=ON" |
|
|
|
|
|
|
|
|
"-DSDL_TIMERS=OFF" |
|
|
"-DSDL_FILE=OFF" |
|
|
"-DSDL_FILE=OFF" |
|
|
"-DSDL_LOADSO=ON" |
|
|
"-DSDL_LOADSO=ON" |
|
|
"-DSDL_CPUINFO=OFF" |
|
|
"-DSDL_CPUINFO=OFF" |
|
@ -97,7 +107,10 @@ ExternalProject_Add(SDL2 |
|
|
"-DSDL_SENSOR=OFF" |
|
|
"-DSDL_SENSOR=OFF" |
|
|
"-DSDL_LOCALE=OFF" |
|
|
"-DSDL_LOCALE=OFF" |
|
|
"-DSDL_MISC=OFF" |
|
|
"-DSDL_MISC=OFF" |
|
|
BUILD_ALWAYS 0) |
|
|
|
|
|
|
|
|
"-DSDL_DIRECTX=OFF" |
|
|
|
|
|
"-DSDL_WASAPI=OFF" |
|
|
|
|
|
"-DSDL_RENDER_D3D=OFF" |
|
|
|
|
|
BUILD_ALWAYS 1) |
|
|
|
|
|
|
|
|
# Build OpenAL Soft module |
|
|
# Build OpenAL Soft module |
|
|
ExternalProject_Add(openal-soft |
|
|
ExternalProject_Add(openal-soft |
|
@ -107,6 +120,9 @@ ExternalProject_Add(openal-soft |
|
|
CMAKE_ARGS |
|
|
CMAKE_ARGS |
|
|
"-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}" |
|
|
"-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}" |
|
|
"-DCMAKE_INSTALL_PREFIX=${MODULE_INSTALL_DIR}" |
|
|
"-DCMAKE_INSTALL_PREFIX=${MODULE_INSTALL_DIR}" |
|
|
|
|
|
"-DCMAKE_C_FLAGS='${CMAKE_C_FLAGS}'" |
|
|
|
|
|
"-DCMAKE_C_FLAGS_DEBUG='${CMAKE_C_FLAGS_DEBUG}'" |
|
|
|
|
|
"-DCMAKE_C_FLAGS_RELEASE='${CMAKE_C_FLAGS_RELEASE}'" |
|
|
"-DLIBTYPE=STATIC" |
|
|
"-DLIBTYPE=STATIC" |
|
|
"-DFORCE_STATIC_VCRT=ON" |
|
|
"-DFORCE_STATIC_VCRT=ON" |
|
|
"-DALSOFT_UTILS=OFF" |
|
|
"-DALSOFT_UTILS=OFF" |
|
@ -203,6 +219,9 @@ ExternalProject_Add(physfs |
|
|
CMAKE_ARGS |
|
|
CMAKE_ARGS |
|
|
"-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}" |
|
|
"-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}" |
|
|
"-DCMAKE_INSTALL_PREFIX=${MODULE_INSTALL_DIR}" |
|
|
"-DCMAKE_INSTALL_PREFIX=${MODULE_INSTALL_DIR}" |
|
|
|
|
|
"-DCMAKE_C_FLAGS='${CMAKE_C_FLAGS}'" |
|
|
|
|
|
"-DCMAKE_C_FLAGS_DEBUG='${CMAKE_C_FLAGS_DEBUG}'" |
|
|
|
|
|
"-DCMAKE_C_FLAGS_RELEASE='${CMAKE_C_FLAGS_RELEASE}'" |
|
|
"-DPHYSFS_ARCHIVE_ZIP=ON" |
|
|
"-DPHYSFS_ARCHIVE_ZIP=ON" |
|
|
"-DPHYSFS_ARCHIVE_7Z=OFF" |
|
|
"-DPHYSFS_ARCHIVE_7Z=OFF" |
|
|
"-DPHYSFS_ARCHIVE_GRP=OFF" |
|
|
"-DPHYSFS_ARCHIVE_GRP=OFF" |
|
@ -216,9 +235,6 @@ ExternalProject_Add(physfs |
|
|
"-DPHYSFS_BUILD_STATIC=ON" |
|
|
"-DPHYSFS_BUILD_STATIC=ON" |
|
|
"-DPHYSFS_BUILD_SHARED=OFF" |
|
|
"-DPHYSFS_BUILD_SHARED=OFF" |
|
|
"-DPHYSFS_BUILD_TEST=OFF" |
|
|
"-DPHYSFS_BUILD_TEST=OFF" |
|
|
"-DCMAKE_C_FLAGS='${CMAKE_C_FLAGS}'" |
|
|
|
|
|
"-DCMAKE_C_FLAGS_DEBUG='${CMAKE_C_FLAGS_DEBUG}'" |
|
|
|
|
|
"-DCMAKE_C_FLAGS_RELEASE='${CMAKE_C_FLAGS_RELEASE}'" |
|
|
|
|
|
BUILD_ALWAYS 0) |
|
|
BUILD_ALWAYS 0) |
|
|
|
|
|
|
|
|
# Build FreeType module |
|
|
# Build FreeType module |
|
@ -233,6 +249,11 @@ ExternalProject_Add(freetype |
|
|
"-DCMAKE_C_FLAGS_DEBUG='${CMAKE_C_FLAGS_DEBUG}'" |
|
|
"-DCMAKE_C_FLAGS_DEBUG='${CMAKE_C_FLAGS_DEBUG}'" |
|
|
"-DCMAKE_C_FLAGS_RELEASE='${CMAKE_C_FLAGS_RELEASE}'" |
|
|
"-DCMAKE_C_FLAGS_RELEASE='${CMAKE_C_FLAGS_RELEASE}'" |
|
|
"-DBUILD_SHARED_LIBS=false" |
|
|
"-DBUILD_SHARED_LIBS=false" |
|
|
|
|
|
"-DFT_DISABLE_ZLIB=ON" |
|
|
|
|
|
"-DFT_DISABLE_BZIP2=ON" |
|
|
|
|
|
"-DFT_DISABLE_PNG=ON" |
|
|
|
|
|
"-DFT_DISABLE_HARFBUZZ=ON" |
|
|
|
|
|
"-DFT_DISABLE_BROTLI=ON" |
|
|
BUILD_ALWAYS 0) |
|
|
BUILD_ALWAYS 0) |
|
|
|
|
|
|
|
|
# Build antkeeper-source module |
|
|
# Build antkeeper-source module |
|
@ -250,6 +271,9 @@ ExternalProject_Add(antkeeper-source |
|
|
"-DCMAKE_CXX_FLAGS='${CMAKE_CXX_FLAGS}'" |
|
|
"-DCMAKE_CXX_FLAGS='${CMAKE_CXX_FLAGS}'" |
|
|
"-DCMAKE_CXX_FLAGS_DEBUG='${CMAKE_CXX_FLAGS_DEBUG}'" |
|
|
"-DCMAKE_CXX_FLAGS_DEBUG='${CMAKE_CXX_FLAGS_DEBUG}'" |
|
|
"-DCMAKE_CXX_FLAGS_RELEASE='${CMAKE_CXX_FLAGS_RELEASE}'" |
|
|
"-DCMAKE_CXX_FLAGS_RELEASE='${CMAKE_CXX_FLAGS_RELEASE}'" |
|
|
|
|
|
"-DCMAKE_EXE_LINKER_FLAGS='${CMAKE_EXE_LINKER_FLAGS}'" |
|
|
|
|
|
"-DCMAKE_EXE_LINKER_FLAGS_DEBUG='${CMAKE_EXE_LINKER_FLAGS_DEBUG}'" |
|
|
|
|
|
"-DCMAKE_EXE_LINKER_FLAGS_RELEASE='${CMAKE_EXE_LINKER_FLAGSRELEASE}'" |
|
|
BUILD_ALWAYS 1) |
|
|
BUILD_ALWAYS 1) |
|
|
|
|
|
|
|
|
# Build antkeeper-data module (if exists) |
|
|
# Build antkeeper-data module (if exists) |
|
|