|
|
@ -67,12 +67,12 @@ enable_testing()
|
|
|
|
|
|
|
|
|
|
|
|
# Check whether we're on a 32-bit or 64-bit system
|
|
|
|
# Check whether we're on a 32-bit or 64-bit system
|
|
|
|
if(CMAKE_SIZEOF_VOID_P EQUAL "8")
|
|
|
|
if(CMAKE_SIZEOF_VOID_P EQUAL "8")
|
|
|
|
message(STATUS "Building on a 64-bit system")
|
|
|
|
set(DEFAULT_ARCH_WIDTH "64")
|
|
|
|
set(ARCH_WIDTH "64")
|
|
|
|
|
|
|
|
else()
|
|
|
|
else()
|
|
|
|
message(STATUS "Building on a 32-bit system")
|
|
|
|
set(DEFAULT_ARCH_WIDTH "32")
|
|
|
|
set(ARCH_WIDTH "32")
|
|
|
|
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
option(ARCH_WIDTH "Platform architecture in bits (32 or 64)" ${DEFAULT_ARCH_WIDTH})
|
|
|
|
|
|
|
|
message(STATUS "Building for a ${ARCH_WIDTH}-bit system")
|
|
|
|
|
|
|
|
|
|
|
|
# Check if we're on FreeBSD so we can exclude the local miniupnpc (it should be installed from ports instead)
|
|
|
|
# Check if we're on FreeBSD so we can exclude the local miniupnpc (it should be installed from ports instead)
|
|
|
|
# CMAKE_SYSTEM_NAME checks are commonly known, but specifically taken from libsdl's CMakeLists
|
|
|
|
# CMAKE_SYSTEM_NAME checks are commonly known, but specifically taken from libsdl's CMakeLists
|
|
|
@ -105,16 +105,16 @@ endif()
|
|
|
|
option(STATIC "Link libraries statically" ${DEFAULT_STATIC})
|
|
|
|
option(STATIC "Link libraries statically" ${DEFAULT_STATIC})
|
|
|
|
|
|
|
|
|
|
|
|
if(MINGW)
|
|
|
|
if(MINGW)
|
|
|
|
get_filename_component(msys2_install_path "[HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MSYS2 64bit;InstallLocation]" ABSOLUTE)
|
|
|
|
get_filename_component(msys2_install_path "[HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MSYS2 ${ARCH_WIDTH}bit;InstallLocation]" ABSOLUTE)
|
|
|
|
set(CMAKE_INCLUDE_PATH "${msys2_install_path}/mingw64/include")
|
|
|
|
set(CMAKE_INCLUDE_PATH "${msys2_install_path}/mingw${ARCH_WIDTH}/include")
|
|
|
|
# This is necessary because otherwise CMake will make Boost libraries -lfoo
|
|
|
|
# This is necessary because otherwise CMake will make Boost libraries -lfoo
|
|
|
|
# rather than a full path. Unfortunately, this makes the shared libraries get
|
|
|
|
# rather than a full path. Unfortunately, this makes the shared libraries get
|
|
|
|
# linked due to a bug in CMake which misses putting -static flags around the
|
|
|
|
# linked due to a bug in CMake which misses putting -static flags around the
|
|
|
|
# -lfoo arguments.
|
|
|
|
# -lfoo arguments.
|
|
|
|
list(REMOVE_ITEM CMAKE_C_IMPLICIT_LINK_DIRECTORIES
|
|
|
|
list(REMOVE_ITEM CMAKE_C_IMPLICIT_LINK_DIRECTORIES
|
|
|
|
"${msys2_install_path}/mingw64/lib")
|
|
|
|
"${msys2_install_path}/mingw${ARCH_WIDTH}/lib")
|
|
|
|
list(REMOVE_ITEM CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES
|
|
|
|
list(REMOVE_ITEM CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES
|
|
|
|
"${msys2_install_path}/mingw64/lib")
|
|
|
|
"${msys2_install_path}/mingw${ARCH_WIDTH}/lib")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
if(STATIC)
|
|
|
|
if(STATIC)
|
|
|
|