OpenRCT2/CMakeLists_mingw.txt
Michał Janiszewski a16de307d7 Refactor project build scripts
This is mostly refactoring of cmake scripts, but also touches build.sh
and install.sh. The cmake should be much more palatable now for major
Linux distributions.

At the same time, new configuration is introduced to Linux version, one
with Twitch enabled.

Please note, however, this change requires update of orctlibs.zip for
mingw builds.
2015-09-28 21:10:21 +02:00

38 lines
1.5 KiB
Text

SET(ACTUAL_SYSTEM ${CMAKE_SYSTEM_NAME})
SET(CMAKE_SYSTEM_NAME Windows)
SET(COMPILER_PREFIX i686-w64-mingw32)
SET(CMAKE_C_COMPILER ${COMPILER_PREFIX}-gcc)
SET(CMAKE_CXX_COMPILER ${COMPILER_PREFIX}-c++)
SET(CMAKE_RC_COMPILER ${COMPILER_PREFIX}-windres)
SET(CMAKE_PKGCONFIG_EXECUTABLE ${COMPILER_PREFIX}-pkg-config)
SET(PKG_CONFIG_EXECUTABLE ${COMPILER_PREFIX}-pkg-config)
# potential flags to make code more similar to MSVC:
# -fshort-wchar -fshort-enums -mms-bitfields
#
set(CMAKE_C_FLAGS "-masm=intel -std=gnu99 -fpack-struct=1" CACHE STRING "" FORCE)
set(CMAKE_CXX_FLAGS "-masm=intel -std=c++0x -std=gnu++0x -fpack-struct=1" CACHE STRING "" FORCE)
if(${ACTUAL_SYSTEM} MATCHES "Linux")
set(CMAKE_SHARED_LINKER_FLAGS "-O3 -static-libgcc -static-libstdc++ -static -lpthread" CACHE STRING "" FORCE)
else()
set(CMAKE_SHARED_LINKER_FLAGS "-static-libgcc -static-libstdc++" CACHE STRING "" FORCE)
endif(${ACTUAL_SYSTEM} MATCHES "Linux")
if(APPLE)
SET(TARGET_ENVIRONMENT /usr/local/mingw-w32-bin_i686-darwin/i686-w64-mingw32)
else()
SET(TARGET_ENVIRONMENT /usr/i686-w64-mingw32)
endif(APPLE)
# here is the target environment located
SET(CMAKE_FIND_ROOT_PATH ${TARGET_ENVIRONMENT})
# adjust the default behaviour of the FIND_XXX() commands:
# search headers and libraries in the target environment, search
# programs in the host environment
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
# INCLUDE_DIRECTORIES(${ORCTLIBS_INCLUDE} ${JANSSON_INCLUDE})