-
Notifications
You must be signed in to change notification settings - Fork 13
/
CMakeLists.txt
49 lines (38 loc) · 1.41 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
# Copyright (c) Open Enclave SDK contributors. Licensed under the MIT License.
# Version 3.1 required for CMAKE_CXX_STANDARD
cmake_minimum_required(VERSION 3.1)
# Set CMAKE_BUILD_TYPE if not specified
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Debug")
endif ()
if (NOT ";Debug;RelWithDebInfo;Release;" MATCHES ";${CMAKE_BUILD_TYPE};")
message(
FATAL_ERROR "CMAKE_BUILD_TYPE must be Debug, RelWithDebInfo or Release")
endif ()
# If CC environment variable has been specified or if CMAKE_C_COMPILER
# cmake variable has been passed to cmake, use the C compiler that has
# been specified. Otherwise, prefer clang. Same for C++ compiler.
# This must be done before `project` command.
if (UNIX)
if (NOT DEFINED ENV{CC} AND NOT DEFINED CMAKE_C_COMPILER)
find_program(CMAKE_C_COMPILER clang-10 clang)
endif ()
if (NOT DEFINED ENV{CXX} AND NOT DEFINED CMAKE_CXX_COMPILER)
find_program(CMAKE_CXX_COMPILER clang++-10 clang++)
endif ()
endif ()
project(oeedger8r)
# Collect Git info
if (IS_DIRECTORY "${PROJECT_SOURCE_DIR}/.git")
# Install Git pre-commit hook
file(COPY scripts/pre-commit scripts/commit-msg
DESTINATION "${PROJECT_SOURCE_DIR}/.git/hooks")
endif ()
option(BUILD_TESTS "Build oeedger8r virtual environment tests" ON)
set(CMAKE_CXX_STANDARD 11)
add_subdirectory(src)
if (BUILD_TESTS)
enable_testing()
add_subdirectory(test)
endif ()
option(CODE_COVERAGE "Enable code coverage testing" OFF)