forked from f4pga/prjxray
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
42 lines (33 loc) · 1.25 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
cmake_minimum_required(VERSION 3.5.0)
project(prjxray)
option(PRJXRAY_BUILD_TESTING "" OFF)
# Add sanitizers-cmake package
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/third_party/sanitizers-cmake/cmake" ${CMAKE_MODULE_PATH})
find_package(Sanitizers)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release CACHE STRING
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
FORCE)
endif()
# Hack for missing option in cctz
option(BUILD_TESTING "" OFF)
if(PRJXRAY_BUILD_TESTING)
enable_testing()
endif()
add_subdirectory(third_party/googletest EXCLUDE_FROM_ALL)
add_subdirectory(third_party/gflags EXCLUDE_FROM_ALL)
add_subdirectory(third_party/cctz EXCLUDE_FROM_ALL)
add_subdirectory(third_party/abseil-cpp EXCLUDE_FROM_ALL)
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-Wundefined-var-template" CXX_COMPILER_SUPPORTS_UNDEF_VAR)
if(${CXX_COMPILER_SUPPORTS_UNDEF_VAR})
add_compile_options("-Wno-undefined-var-template")
endif()
option(YAML_CPP_BUILD_TESTS "" OFF)
add_subdirectory(third_party/yaml-cpp EXCLUDE_FROM_ALL)
target_include_directories(yaml-cpp PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/third_party/yaml-cpp/include>
)
add_compile_options(-Wall -Werror)
add_subdirectory(lib)
add_subdirectory(tools)