summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorAustin S. Hemmelgarn <austin@netdata.cloud>2024-03-20 14:03:15 -0400
committerGitHub <noreply@github.com>2024-03-20 14:03:15 -0400
commit8128af5210538780af89c87f9d87c246baa0b043 (patch)
tree839225b1b7dda284a0afc89553a5a6383f8cd165 /CMakeLists.txt
parent11cf7564d5e3cdf524c38c6b29141932e5cfcbde (diff)
Move bundling of libyaml to CMake. (#17190)
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt28
1 files changed, 13 insertions, 15 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d72320bc4c..8bd91c8d82 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -269,6 +269,18 @@ if(NOT HAVE_LOG10)
endif()
#
+# Custom modules
+#
+
+include(NetdataYAML)
+
+#
+# Checks from custom modules
+#
+
+netdata_detect_libyaml()
+
+#
# check include files
#
@@ -1525,21 +1537,7 @@ endif()
# message(FATAL_ERROR "jsonc libraries: ${JSONC_LIBRARIES}")
# message(FATAL_ERROR "jsonc ldflags: ${JSONC_LDFLAGS}")
-# yaml
-set(HAVE_LIBYAML True)
-if(ENABLE_BUNDLED_YAML)
- add_library(yaml STATIC IMPORTED)
- set_property(TARGET yaml PROPERTY
- IMPORTED_LOCATION "${CMAKE_SOURCE_DIR}/externaldeps/libyaml/libyaml.a")
-
- target_include_directories(libnetdata BEFORE PUBLIC "${CMAKE_SOURCE_DIR}/externaldeps/libyaml")
- target_link_libraries(libnetdata PUBLIC yaml)
-else()
- pkg_check_modules(YAML REQUIRED yaml-0.1)
- target_include_directories(libnetdata BEFORE PUBLIC ${YAML_INCLUDE_DIRS})
- target_compile_definitions(libnetdata PUBLIC ${YAML_CFLAGS_OTHER})
- target_link_libraries(libnetdata PUBLIC ${YAML_LDFLAGS})
-endif()
+netdata_add_libyaml_to_target(libnetdata)
# zlib
pkg_check_modules(ZLIB REQUIRED zlib)