summaryrefslogtreecommitdiff
path: root/compiler/cwrap/CMakeLists.txt
blob: e1ae4d0b506049e7fb5e9b5e6e0a3c3d544c328a (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 SOURCES "src/*.cpp")
file(GLOB_RECURSE TESTS "src/*.test.cpp")
list(REMOVE_ITEM SOURCES ${TESTS})

add_library(cwrap STATIC ${SOURCES})
set_target_properties(cwrap PROPERTIES POSITION_INDEPENDENT_CODE ON)
set_target_properties(cwrap PROPERTIES LINKER_LANGUAGE CXX)
target_include_directories(cwrap PUBLIC include)
# Let's apply nncc common compile options
# NOTE This will enable strict compilation (warnings as error).
#      Please refer to top-level CMakeLists.txt for details
target_link_libraries(cwrap PRIVATE nncc_common)

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

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

GTest_AddTest(cwrap_test ${TESTS})
target_link_libraries(cwrap_test cwrap)