summaryrefslogtreecommitdiff
path: root/compiler/angkor/CMakeLists.txt
blob: 44b5e90584a26c6e685a6c762119f2475453b742 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
file(GLOB_RECURSE HEADERS "include/*.h")
file(GLOB_RECURSE SOURCES "src/*.cpp")
file(GLOB_RECURSE TESTS "src/*.test.cpp")
list(REMOVE_ITEM SOURCES ${TESTS})

# NOTE STATIC is deliberately used here to allow clients to use 'angkor' without installation
add_library(angkor STATIC ${HEADERS} ${SOURCES})
set_target_properties(angkor PROPERTIES POSITION_INDEPENDENT_CODE ON)
set_target_properties(angkor PROPERTIES LINKER_LANGUAGE CXX)
target_include_directories(angkor PUBLIC include)
target_link_libraries(angkor PRIVATE nncc_common)
target_link_libraries(angkor PUBLIC nncc_coverage)

if(NOT ENABLE_TEST)
  return()
endif(NOT ENABLE_TEST)

# Google Test is mandatory for test
nnas_find_package(GTest REQUIRED)

GTest_AddTest(angkor_test ${TESTS})
target_link_libraries(angkor_test angkor)