'nncc_core' as a static library (#1754)
author박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com>
Fri, 5 Oct 2018 01:08:10 +0000 (10:08 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Fri, 5 Oct 2018 01:08:10 +0000 (10:08 +0900)
This commit converts 'nncc_core' as a static library in order to
permit the use of this library without installation.

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
libs/core/CMakeLists.txt

index 4a83c0b..688d476 100644 (file)
@@ -3,7 +3,9 @@ file(GLOB_RECURSE SOURCES "src/*.cpp")
 file(GLOB_RECURSE TESTS "src/*.test.cpp")
 list(REMOVE_ITEM SOURCES ${TESTS})
 
-add_nncc_library(nncc_core SHARED ${HEADERS} ${SOURCES})
+# NOTE STATIC is deliberately used here to allow clients to use 'nncc_core' without installation
+add_nncc_library(nncc_core STATIC ${HEADERS} ${SOURCES})
+set_target_properties(nncc_core PROPERTIES POSITION_INDEPENDENT_CODE ON)
 set_target_properties(nncc_core PROPERTIES LINKER_LANGUAGE CXX)
 target_include_directories(nncc_core PUBLIC include)
 target_link_libraries(nncc_core PUBLIC nncc_foundation)