-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCMakeLists.txt
74 lines (54 loc) · 2.07 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
cmake_minimum_required(VERSION 3.15)
########################## Global Project Attributes ##########################
project(EtcPal)
set(ETCPAL_ROOT ${CMAKE_CURRENT_LIST_DIR})
set(ETCPAL_CMAKE ${ETCPAL_ROOT}/cmake)
option(ETCPAL_BUILD_MOCK_LIB "Build the EtcPalMock library" OFF)
option(ETCPAL_BUILD_TESTS "Build the EtcPal unit tests" OFF)
option(ETCPAL_BUILD_EXAMPLES "Build the EtcPal example apps" OFF)
option(ETCPAL_INSTALL_PDBS "Include PDBs in EtcPal install target" ON)
option(ETCPAL_EXPLICITLY_DISABLE_EXCEPTIONS "Disable throwing of exceptions throughout the EtcPal C++ headers" OFF)
############################## Standalone Support #############################
include(${ETCPAL_CMAKE}/OSS.cmake)
determine_compile_environment()
set(QUALITY_GATES_ENABLED OFF)
if(NOT COMPILING_AS_OSS)
option(ETCPAL_FORCE_QUALITY_GATES "Force enable quality gate setup even if not building standalone" OFF)
get_directory_property(HAS_PARENT PARENT_DIRECTORY)
if(HAS_PARENT)
if(ETCPAL_FORCE_QUALITY_GATES)
set(QUALITY_GATES_ENABLED ON)
endif()
else()
set(QUALITY_GATES_ENABLED ON)
endif()
endif()
if(QUALITY_GATES_ENABLED)
include(${ETCPAL_CMAKE}/AddCMakeTools.cmake)
include(${CMAKE_TOOLS_MODULES}/QualityGateHelpers.cmake)
setup_standalone_compile()
setup_clang_format()
setup_clang_tidy()
setup_address_sanitizer()
setup_memory_sanitizer()
setup_undefined_behavior_sanitizer()
setup_thread_sanitizer()
endif()
# Platform support + core sources
include(${ETCPAL_CMAKE}/etcpal-os.cmake)
include(${ETCPAL_CMAKE}/etcpal-core-sources.cmake)
if(ETCPAL_BUILD_MOCK_LIB OR ETCPAL_BUILD_TESTS)
add_subdirectory(external/fff)
endif()
################################# Main library ################################
add_subdirectory(src)
#################################### Tests ####################################
if(ETCPAL_BUILD_TESTS)
add_subdirectory(external/unity)
enable_testing()
add_subdirectory(tests)
endif()
################################## Examples ###################################
if(ETCPAL_BUILD_EXAMPLES)
add_subdirectory(examples)
endif()