-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
54 lines (41 loc) · 1.28 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
cmake_minimum_required(VERSION 3.16.0)
project(Bomberman LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
option(BUILD_TEST_SUITE OFF)
option(ENABLE_CODE_COVERAGE OFF)
# Add ./cmake to the module path
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
include(DetectCompiler)
find_package(raylib REQUIRED)
add_subdirectory(src)
# Unit testing
if(BUILD_TEST_SUITE)
# Check for GoogleTest
find_package(googletest REQUIRED)
# Disable error on Linux release builds
if(COMPILER_TYPE MATCHES "gcc")
target_compile_options(gtest PRIVATE "-Wno-error=restrict")
target_compile_options(gmock PRIVATE "-Wno-error=restrict")
endif()
enable_testing()
add_subdirectory(tests)
endif()
# Copy the Web files (html/js/wasm/...) into the web directory on install
if(EMSCRIPTEN)
install(
FILES ${PROJECT_BINARY_DIR}/src/bomberman.html
CONFIGURATIONS Release
DESTINATION web
RENAME index.html
)
install(
FILES
${PROJECT_BINARY_DIR}/src/bomberman.data
${PROJECT_BINARY_DIR}/src/bomberman.js
${PROJECT_BINARY_DIR}/src/bomberman.wasm
${PROJECT_SOURCE_DIR}/assets/favicon.ico
CONFIGURATIONS Release
DESTINATION web
)
endif()