Skip to content

Commit 7afa081

Browse files
author
Abhi Keshav
committed
Create libyang static library
1 parent 19dfba0 commit 7afa081

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,16 @@ set(headers
111111
src/xml.h
112112
src/dict.h)
113113

114+
# create static libyang library
115+
if(STATIC)
116+
add_library(yang_static STATIC ${libsrc})
117+
set_target_properties(yang_static PROPERTIES OUTPUT_NAME yang)
118+
target_link_libraries(yang_static m)
119+
target_link_libraries(yang_static ${CMAKE_THREAD_LIBS_INIT})
120+
target_link_libraries(yang_static ${PCRE_LIBRARIES})
121+
install(TARGETS yang_static DESTINATION ${LIB_INSTALL_DIR})
122+
endif(STATIC)
123+
114124
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
115125
add_library(yangobj OBJECT ${libsrc})
116126
add_library(yang SHARED $<TARGET_OBJECTS:yangobj>)

0 commit comments

Comments
 (0)