-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
48 lines (34 loc) · 1.2 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
cmake_minimum_required(VERSION 3.15)
project(
vmmu
VERSION 0.9.0
DESCRIPTION "An implementation of the x86 MMU"
HOMEPAGE_URL https://github.com/blitz/vmmu
LANGUAGES CXX)
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
include(GNUInstallDirs)
include(CTest)
set(DEFAULT_BUILD_TYPE "Debug")
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to '${DEFAULT_BUILD_TYPE}' as none was specified.")
set(CMAKE_BUILD_TYPE "${DEFAULT_BUILD_TYPE}" CACHE
STRING "Choose the type of build." FORCE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release"
"MinSizeRel" "RelWithDebInfo")
endif()
option(ASAN "Enable the address sanitizer" OFF)
if(ASAN)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
set (CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} -fsanitize=address")
endif()
option(BUILD_COVERAGE "Build with code coverage instrumentation" OFF)
if(BUILD_COVERAGE)
include(CodeCoverage)
append_coverage_compiler_flags()
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/coverage-xml.xml
DESTINATION ${CMAKE_INSTALL_DOCDIR}/vmmu/)
endif()
add_subdirectory(libvmmu)
if(BUILD_TESTING)
add_subdirectory(test)
endif()