PokemonScriptTester/CMakeLists.txt

35 lines
1.1 KiB
CMake

cmake_minimum_required(VERSION 3.18)
project(PokemonScriptTester)
set(CMAKE_CXX_STANDARD 20)
option(WINDOWS "Whether the build target is Windows or not." OFF)
set(STATICC TRUE)
include(CMakeLists.txt.in)
include_pkmnlib()
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
add_compile_options(-fconcepts)
endif ()
file(GLOB_RECURSE SRC_FILES src/*.cpp src/*.hpp)
add_executable(PokemonScriptTester ${SRC_FILES})
target_precompile_headers(PokemonScriptTester PUBLIC src/Precompiled.hxx)
add_definitions(-DLEVEL_U8)
SET(_LINKS Arbutils CreatureLib pkmnLib -lpthread)
target_link_libraries(PokemonScriptTester PUBLIC ${_LINKS})
target_compile_options(PokemonScriptTester PRIVATE -Wall -Wextra -Werror)
if (WINDOWS)
MESSAGE(WARNING, "Using Windows Build.")
# Add a definition for the compiler, so we can use it in C++ as well.
ADD_DEFINITIONS(-D WINDOWS=1)
# -m64: Build a 64 bit library
add_compile_options(-m64)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-allow-multiple-definition")
if (SHARED)
set_target_properties(PokemonScriptTester PROPERTIES SUFFIX ".dll")
endif(SHARED)
endif (WINDOWS)