forked from LeHulk1/RandoBlazer
-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
81 lines (73 loc) · 1.92 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
cmake_minimum_required(VERSION 3.12)
project(RandoBlazer)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
if(ASAN)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-omit-frame-pointer -fsanitize=address")
set(CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} -fno-omit-frame-pointer -fsanitize=address")
endif()
include(FetchContent)
FetchContent_Declare(
Boost-CMake
GIT_REPOSITORY https://github.com/Orphis/boost-cmake.git
)
FetchContent_GetProperties(Boost-CMake)
if(NOT boost-cmake_POPULATED)
FetchContent_Populate(Boost-CMake)
add_subdirectory(${boost-cmake_SOURCE_DIR} ${boost-cmake_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()
add_library(randoblazerlib STATIC
Item.cpp
Item.h
Lair.cpp
Lair.h
Log.cpp
Log.h
Map.cpp
Map.h
Random.cpp
Random.h
Randomizer.cpp
Randomizer.h
ROMCheck.cpp
ROMCheck.h
ROMData.cpp
ROMData.h
ROMUpdate.cpp
ROMUpdate.h
Sprite.cpp
Sprite.h
TextUpdate.cpp
TextUpdate.h
)
target_link_libraries(randoblazerlib PRIVATE Boost::random)
if(CMAKE_SYSTEM_NAME MATCHES "Emscripten")
add_executable(randoblazer_emscripten
Emscripten.cpp
)
target_compile_options(randoblazer_emscripten PRIVATE --bind)
target_link_libraries(randoblazer_emscripten PRIVATE randoblazerlib --bind)
set_target_properties(randoblazer_emscripten PROPERTIES
OUTPUT_NAME randoblazer
)
else()
add_executable(randoblazer_cli
cli.cpp
)
target_link_libraries(randoblazer_cli PRIVATE randoblazerlib)
set_target_properties(randoblazer_cli PROPERTIES
OUTPUT_NAME randoblazer
)
endif()
if (ROM)
message(STATUS "ROM found at: ${ROM}")
enable_testing()
add_test(
NAME portability_check
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_LIST_DIR}/run-test.cmake "-DEXE=$<TARGET_FILE:randoblazer_cli>" "-DROM=${ROM}"
)
set_tests_properties(portability_check PROPERTIES
ENVIRONMENT "EXE=$<TARGET_FILE:randoblazer_cli>;ROM=${ROM}"
)
endif()