summaryrefslogtreecommitdiff
path: root/compiler/locop/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/locop/CMakeLists.txt')
-rw-r--r--compiler/locop/CMakeLists.txt27
1 files changed, 27 insertions, 0 deletions
diff --git a/compiler/locop/CMakeLists.txt b/compiler/locop/CMakeLists.txt
new file mode 100644
index 000000000..107ee8be8
--- /dev/null
+++ b/compiler/locop/CMakeLists.txt
@@ -0,0 +1,27 @@
+file(GLOB_RECURSE SOURCES "src/*.cpp")
+file(GLOB_RECURSE TESTS "src/*.test.cpp")
+list(REMOVE_ITEM SOURCES ${TESTS})
+
+add_library(locop STATIC ${SOURCES})
+set_target_properties(locop PROPERTIES POSITION_INDEPENDENT_CODE ON)
+target_include_directories(locop PUBLIC include)
+target_link_libraries(locop PUBLIC loco)
+# Let's apply nncc common compile options
+#
+# NOTE This will enable strict compilation (warnings as error).
+# Please refer to the top-level CMakeLists.txt for details
+target_link_libraries(locop PRIVATE nncc_common)
+target_link_libraries(locop PUBLIC nncc_coverage)
+target_link_libraries(locop PRIVATE pp)
+target_link_libraries(locop PRIVATE stdex)
+
+if(NOT ENABLE_TEST)
+ return()
+endif(NOT ENABLE_TEST)
+
+# Google Test is mandatory for internal testing
+nnas_find_package(GTest REQUIRED)
+
+GTest_AddTest(locop_test ${TESTS})
+target_link_libraries(locop_test stdex)
+target_link_libraries(locop_test locop)