summaryrefslogtreecommitdiff
path: root/compiler/cwrap/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/cwrap/CMakeLists.txt')
-rw-r--r--compiler/cwrap/CMakeLists.txt22
1 files changed, 22 insertions, 0 deletions
diff --git a/compiler/cwrap/CMakeLists.txt b/compiler/cwrap/CMakeLists.txt
new file mode 100644
index 000000000..e1ae4d0b5
--- /dev/null
+++ b/compiler/cwrap/CMakeLists.txt
@@ -0,0 +1,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)