File tree 2 files changed +5
-8
lines changed
2 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -245,6 +245,7 @@ option(ENABLE_PERF_TESTS "Build performance tests" OFF)
245
245
option (ENABLE_COVERAGE "Build code coverage report from tests" OFF )
246
246
option (ENABLE_FUZZ_TARGETS "Build target programs suitable for fuzzing with AFL" OFF )
247
247
option (ENABLE_INTERNAL_DOCS "Generate doxygen documentation also from internal headers" OFF )
248
+ option (BUILD_SHARED_LIBS "By default, shared libs are enabled. Turn off for a static build." ON )
248
249
set (YANG_MODULE_DIR "${CMAKE_INSTALL_PREFIX} /${CMAKE_INSTALL_DATADIR} /yang/modules/libyang" CACHE STRING "Directory where to copy the YANG modules to" )
249
250
250
251
if (ENABLE_INTERNAL_DOCS)
@@ -262,14 +263,10 @@ set(PLUGINS_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/libyang" CACHE
262
263
set (PLUGINS_DIR_EXTENSIONS "${PLUGINS_DIR} /extensions" CACHE STRING "Directory with libyang user extensions plugins" )
263
264
set (PLUGINS_DIR_TYPES "${PLUGINS_DIR} /types" CACHE STRING "Directory with libyang user types plugins" )
264
265
265
- # by default build shared library
266
- # static build requires static libpcre2 library
267
- option (ENABLE_STATIC "Build static (.a) library" OFF )
268
-
269
266
#
270
267
# checks
271
268
#
272
- if (ENABLE_STATIC )
269
+ if (NOT BUILD_SHARED_LIBS )
273
270
message (STATUS "Disabling tests for static build" )
274
271
set (ENABLE_TESTS OFF )
275
272
set (ENABLE_VALGRIND_TESTS OFF )
@@ -341,7 +338,7 @@ endif()
341
338
use_compat()
342
339
343
340
# create static libyang library
344
- if (ENABLE_STATIC )
341
+ if (NOT BUILD_SHARED_LIBS )
345
342
add_definitions (-DSTATIC)
346
343
347
344
# allow binaries compilation linking both static and dynamic libraries never linking static glibc
Original file line number Diff line number Diff line change 58
58
* ENABLE_VALGRIND_TESTS | Build tests with valgrind. | OFF
59
59
* ENABLE_COVERAGE | Build code coverage report from tests. | OFF
60
60
* ENABLE_FUZZ_TARGETS | Build target programs suitable for fuzzing with AFL. | OFF
61
- * ENABLE_STATIC | Build static (.a) library | OFF
61
+ * BUILD_SHARED_LIBS | Build shared (.so) instead of static (.a) library | ON
62
62
* INTERNAL_DOCS | Include developers notes and internal API description into generated Documentation | OFF
63
63
*
64
64
* Here is the list of available important targets for the `make(1)` tool:
85
85
* ENABLE_VALGRIND_TESTS | Build tests with valgrind. | ON
86
86
* ENABLE_COVERAGE | Build code coverage report from tests. | OFF
87
87
* ENABLE_FUZZ_TARGETS | Build target programs suitable for fuzzing with AFL. | OFF
88
- * ENABLE_STATIC | Build static (.a) library | OFF
88
+ * BUILD_SHARED_LIBS | Build shared (.so) instead of static (.a) library | ON
89
89
* INTERNAL_DOCS | Include developers notes and internal API description into generated Documentation | OFF
90
90
*
91
91
* Here is the list of available important targets for the `make(1)` tool:
You can’t perform that action at this time.
0 commit comments