2021-08-29 09:42:50 +00:00
|
|
|
cmake_minimum_required(VERSION 3.18)
|
2021-08-22 17:03:03 +00:00
|
|
|
project(PokemonScriptTester)
|
|
|
|
|
|
|
|
set(CMAKE_CXX_STANDARD 20)
|
2021-08-29 14:10:14 +00:00
|
|
|
set(BUILD_SHARED_LIBS OFF)
|
2021-08-22 17:03:03 +00:00
|
|
|
|
|
|
|
option(WINDOWS "Whether the build target is Windows or not." OFF)
|
2021-08-29 14:10:14 +00:00
|
|
|
set(SHARED OFF)
|
2021-08-22 17:03:03 +00:00
|
|
|
|
|
|
|
include(CMakeLists.txt.in)
|
|
|
|
include_pkmnlib()
|
|
|
|
|
2021-08-29 10:42:59 +00:00
|
|
|
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
|
|
|
add_compile_options(-fconcepts)
|
|
|
|
endif ()
|
|
|
|
|
2021-08-29 14:10:14 +00:00
|
|
|
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
|
|
|
add_link_options(-fuse-ld=lld)
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
|
2021-10-23 12:28:53 +00:00
|
|
|
file(GLOB_RECURSE SRC_FILES src/*.cpp src/*.hpp extern/AngelscriptDebugger/src/*.cpp)
|
2021-08-22 17:03:03 +00:00
|
|
|
add_executable(PokemonScriptTester ${SRC_FILES})
|
|
|
|
target_precompile_headers(PokemonScriptTester PUBLIC src/Precompiled.hxx)
|
|
|
|
add_definitions(-DLEVEL_U8)
|
|
|
|
|
2021-08-29 14:10:14 +00:00
|
|
|
SET(_LINKS -static pkmnLib)
|
2021-08-22 17:03:03 +00:00
|
|
|
target_link_libraries(PokemonScriptTester PUBLIC ${_LINKS})
|
|
|
|
target_compile_options(PokemonScriptTester PRIVATE -Wall -Wextra -Werror)
|
2021-08-29 10:14:27 +00:00
|
|
|
|
|
|
|
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)
|
2021-08-29 10:59:38 +00:00
|
|
|
set_target_properties(PokemonScriptTester PROPERTIES SUFFIX ".exe")
|
2021-08-29 10:14:27 +00:00
|
|
|
endif(SHARED)
|
2021-09-07 17:13:10 +00:00
|
|
|
endif (WINDOWS)
|
|
|
|
|
2021-09-07 17:42:34 +00:00
|
|
|
set(PRE_CONFIGURE_FILE "git.h.in")
|
|
|
|
set(POST_CONFIGURE_FILE "src/git.h")
|
|
|
|
include(git_watcher.cmake)
|
2021-10-23 12:28:53 +00:00
|
|
|
add_dependencies(PokemonScriptTester check_git)
|