modify NetdataYAML.cmake to fix compilation error (#21295)
kkz committed
May 21, 2026 at 22:24 UTC
130e0a8f694012e7f03aabefffae3905c0ed0239
1 file changed
+3
-2
packaging/cmake/Modules/NetdataYAML.cmake
+3
-2
@@ -70,11 +70,12 @@ endmacro()
70
# The specified target must already exist, and the netdata_detect_libyaml
71
# macro must have already been run at least once for this to work correctly.
72
function(netdata_add_libyaml_to_target _target)
73
- if(ENABLE_BUNDLED_LIBYAML)
73
+ if(ENABLE_BUNDLED_LIBYAML OR NOT YAML_FOUND)
74
target_include_directories(${_target} BEFORE PUBLIC ${NETDATA_YAML_INCLUDE_DIRS})
75
+ target_compile_definitions(${_target} PUBLIC ${NETDATA_YAML_CFLAGS_OTHER})
76
else()
77
target_include_directories(${_target} PUBLIC ${NETDATA_YAML_INCLUDE_DIRS})
78
+ target_compile_options(${_target} PUBLIC ${NETDATA_YAML_CFLAGS_OTHER})
79
endif()
78
- target_compile_options(${_target} PUBLIC ${NETDATA_YAML_CFLAGS_OTHER})
80
target_link_libraries(${_target} PUBLIC ${NETDATA_YAML_LDFLAGS})
81
endfunction()