1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2024-11-08 00:37:15 +01:00
SqMod/CMakeLists.txt

42 lines
1.4 KiB
CMake
Raw Normal View History

cmake_minimum_required(VERSION 3.21)
project(SqMod)
# This plug-in only works on 64-bit
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
2023-03-05 14:37:30 +01:00
message(FATAL_ERROR "SqMod does not support 32-bit platforms anymore.")
endif()
2020-03-22 19:53:52 +01:00
# Tell CMake where to find our scripts
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake ${PROJECT_SOURCE_DIR}/vendor/POCO/cmake)
2020-03-22 19:53:52 +01:00
# Several plugin options
2020-05-01 19:41:00 +02:00
option(ENABLE_API21 "Build for 2.1 API." OFF)
2021-03-26 23:18:51 +01:00
option(ENABLE_OFFICIAL "Enable compatibility with official legacy plug-in" ON)
# As a fall-back for certain situations (mainly some docker ubuntu containers)
2021-09-21 20:05:08 +02:00
option(ENABLE_BUILTIN_MYSQL_C "Enable built-in MySQL connector library" OFF)
#option(FORCE_32BIT_BIN "Create a 32-bit executable binary if the compiler defaults to 64-bit." OFF)
2021-01-31 22:04:36 +01:00
# This option should only be available in certain conditions
if(WIN32 AND MINGW)
2023-03-05 14:37:30 +01:00
option(COPY_DEPENDENCIES "Copy dependent DLLs into the deps folder." OFF)
2021-01-31 22:04:36 +01:00
endif()
# Discord suppport
option(ENABLE_DISCORD "Enable built-in Discord support." ON)
# C++17 is mandatory (globally)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
2021-09-06 18:14:09 +02:00
# Strip binary
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -s -g")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s -g")
# Enable position independent code
2021-01-31 17:48:31 +01:00
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
2021-02-01 00:49:03 +01:00
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif()
2020-05-28 20:27:44 +02:00
# Include vendor libraries
add_subdirectory(vendor)
# Include Module library
add_subdirectory(module)