mirror of https://github.com/OpenRCT2/OpenRCT2.git
commit
91d4058850
|
@ -60,8 +60,44 @@ execute_process(
|
|||
)
|
||||
add_definitions(-DOPENRCT2_COMMIT_SHA1_SHORT="${OPENRCT2_COMMIT_SHA1_SHORT}")
|
||||
|
||||
# Convenience functions to set compiler flags only if available
|
||||
include(CheckCCompilerFlag)
|
||||
include(CheckCXXCompilerFlag)
|
||||
|
||||
function(ADD_CHECK_C_COMPILER_FLAG
|
||||
_CFLAGS
|
||||
_CACHE_VAR
|
||||
_FLAG
|
||||
)
|
||||
|
||||
CHECK_C_COMPILER_FLAG("${_FLAG}" "${_CACHE_VAR}")
|
||||
if(${_CACHE_VAR})
|
||||
# message(STATUS "Using CFLAG: ${_FLAG}")
|
||||
set(${_CFLAGS} "${${_CFLAGS}} ${_FLAG}" PARENT_SCOPE)
|
||||
else()
|
||||
message(STATUS "Unsupported CFLAG: ${_FLAG}")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(ADD_CHECK_CXX_COMPILER_FLAG
|
||||
_CXXFLAGS
|
||||
_CACHE_VAR
|
||||
_FLAG
|
||||
)
|
||||
|
||||
CHECK_CXX_COMPILER_FLAG("${_FLAG}" "${_CACHE_VAR}")
|
||||
if(${_CACHE_VAR})
|
||||
# message(STATUS "Using CXXFLAG: ${_FLAG}")
|
||||
set(${_CXXFLAGS} "${${_CXXFLAGS}} ${_FLAG}" PARENT_SCOPE)
|
||||
else()
|
||||
message(STATUS "Unsupported CXXFLAG: ${_FLAG}")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# pkg-config
|
||||
INCLUDE(FindPkgConfig)
|
||||
|
||||
# Needed for linking with non-broken OpenSSL on Apple platforms
|
||||
if (APPLE)
|
||||
set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:/usr/local/opt/openssl/lib/pkgconfig")
|
||||
endif (APPLE)
|
||||
|
@ -79,7 +115,6 @@ option(FORCE32 "Force 32-bit build. It will add `-m32` to compiler flags")
|
|||
option(DISABLE_OPENGL "Disable OpenGL support.")
|
||||
option(DISABLE_RCT2 "Build a standalone version, without using code and data segments from vanilla. On by default." ON)
|
||||
option(USE_MMAP "Use mmap to try loading rct2's data segment into memory.")
|
||||
option(LAUNCHPAD_BUILD "Sets some build system options on launchpad.net")
|
||||
|
||||
set(COMMON_COMPILE_OPTIONS "${COMMON_COMPILE_OPTIONS} -fstrict-aliasing -Werror -Wundef -Wmissing-declarations -Winit-self -Wall -Wno-unknown-pragmas -Wno-unused-function -Wno-missing-braces -Wno-comment")
|
||||
|
||||
|
@ -93,13 +128,12 @@ if (NOT DISABLE_RCT2)
|
|||
message("DISABLE_RCT2 implies FORCE32")
|
||||
endif()
|
||||
|
||||
if (LAUNCHPAD_BUILD)
|
||||
# Launchpad turns on -Wdate-time for compilers that support it, this shouldn't break our build
|
||||
set(COMMON_COMPILE_OPTIONS "${COMMON_COMPILE_OPTIONS} -Wno-error=date-time")
|
||||
else()
|
||||
if (FORCE32)
|
||||
set(TARGET_M "-m32")
|
||||
endif()
|
||||
# Launchpad turns on -Wdate-time for compilers that support it, this shouldn't break our build
|
||||
ADD_CHECK_C_COMPILER_FLAG(CMAKE_C_FLAGS C_WARN_WRITE_STRINGS -Wno-error=date-time)
|
||||
ADD_CHECK_CXX_COMPILER_FLAG(CMAKE_CXX_FLAGS CXX_WARN_WRITE_STRINGS -Wno-error=date-time)
|
||||
|
||||
if (FORCE32)
|
||||
set(TARGET_M "-m32")
|
||||
endif()
|
||||
|
||||
if (FORCE32)
|
||||
|
|
|
@ -2,10 +2,5 @@
|
|||
|
||||
BUILDDIR=build_dir
|
||||
|
||||
extra_flags := "-DLAUNCHPAD_BUILD=on"
|
||||
|
||||
override_dh_auto_configure:
|
||||
dh_auto_configure -a -- $(extra_flags)
|
||||
|
||||
%:
|
||||
dh $@
|
||||
|
|
Loading…
Reference in New Issue