summaryrefslogtreecommitdiff
path: root/compiler/pp/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/pp/CMakeLists.txt')
-rw-r--r--compiler/pp/CMakeLists.txt20
1 files changed, 20 insertions, 0 deletions
diff --git a/compiler/pp/CMakeLists.txt b/compiler/pp/CMakeLists.txt
new file mode 100644
index 000000000..2c25c6406
--- /dev/null
+++ b/compiler/pp/CMakeLists.txt
@@ -0,0 +1,20 @@
+file(GLOB_RECURSE SOURCES "src/*.cpp")
+file(GLOB_RECURSE TESTS "src/*.test.cpp")
+list(REMOVE_ITEM SOURCES ${TESTS})
+
+add_library(pp STATIC ${SOURCES})
+set_target_properties(pp PROPERTIES POSITION_INDEPENDENT_CODE ON)
+target_include_directories(pp PUBLIC include)
+target_link_libraries(pp PRIVATE nncc_common)
+
+if(NOT ENABLE_TEST)
+ return()
+endif(NOT ENABLE_TEST)
+
+# Google Test is mandatory for internal testing
+nnas_find_package(GTest REQUIRED)
+
+add_executable(pp_test ${TESTS})
+target_link_libraries(pp_test pp)
+target_link_libraries(pp_test gtest_main)
+add_test(pp_test pp_test)