mirror of
https://github.com/OpenRCT2/OpenRCT2.git
synced 2025-01-22 10:21:57 -05:00
Move FORCE32 option to top-level CMakeLists.txt
This commit is contained in:
parent
a9179fff52
commit
8ec5f3ae82
4 changed files with 13 additions and 19 deletions
|
@ -22,6 +22,13 @@ option(WITH_TESTS "Build tests")
|
|||
option(PORTABLE "Create a portable build (-rpath=$ORIGIN)" OFF)
|
||||
option(DOWNLOAD_TITLE_SEQUENCES "Download title sequences during installation." ON)
|
||||
|
||||
if (FORCE32)
|
||||
set(TARGET_M "-m32")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${TARGET_M}")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TARGET_M}")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${TARGET_M}")
|
||||
endif ()
|
||||
|
||||
# Define current git branch
|
||||
execute_process(
|
||||
COMMAND git rev-parse --abbrev-ref HEAD
|
||||
|
|
|
@ -26,9 +26,5 @@ target_link_libraries(${PROJECT} "libopenrct2")
|
|||
target_include_directories(${PROJECT} PRIVATE "${CMAKE_CURRENT_LIST_DIR}/..")
|
||||
|
||||
# Compiler flags
|
||||
if (FORCE32)
|
||||
set(TARGET_M "-m32")
|
||||
endif ()
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11 ${TARGET_M}")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++14 ${TARGET_M}")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${TARGET_M}")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++14")
|
||||
|
|
|
@ -66,18 +66,14 @@ target_include_directories(${PROJECT} PRIVATE "${CMAKE_CURRENT_LIST_DIR}/.."
|
|||
target_include_directories(${PROJECT} SYSTEM PRIVATE ${SDL2_INCLUDE_DIRS})
|
||||
|
||||
# Compiler flags
|
||||
if (FORCE32)
|
||||
set(TARGET_M "-m32")
|
||||
endif ()
|
||||
if (WIN32)
|
||||
# mingw complains about "%zu" not being a valid format specifier for printf, unless we
|
||||
# tell it that it is
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__USE_MINGW_ANSI_STDIO=1")
|
||||
endif ()
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11 ${TARGET_M}")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++14 ${TARGET_M}")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${TARGET_M}")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++14")
|
||||
|
||||
# Defines
|
||||
if (DISABLE_OPENGL)
|
||||
|
|
|
@ -241,13 +241,8 @@ else ()
|
|||
set(PIE_FLAG "-fpie")
|
||||
endif ()
|
||||
|
||||
if (FORCE32)
|
||||
set(TARGET_M "-m32")
|
||||
endif ()
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11 ${COMMON_COMPILE_OPTIONS} ${TARGET_M} -Wimplicit")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++14 ${COMMON_COMPILE_OPTIONS} ${TARGET_M}")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${TARGET_M}")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11 ${COMMON_COMPILE_OPTIONS} -Wimplicit")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++14 ${COMMON_COMPILE_OPTIONS}")
|
||||
|
||||
# Defines
|
||||
if (USE_MMAP)
|
||||
|
|
Loading…
Reference in a new issue