Skip to content

Commit 5fa7805

Browse files
committed
Build yaml-filter submodule
And include it to the libopenscap.so.
1 parent 59f741f commit 5fa7805

File tree

6 files changed

+13
-37
lines changed

6 files changed

+13
-37
lines changed

CMakeLists.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@ if(GCRYPT_FOUND OR NSS_FOUND)
165165
endif()
166166

167167
find_package(Libyaml)
168-
find_package(Yamlpath)
169168

170169
check_library_exists(rt clock_gettime "" HAVE_CLOCK_GETTIME)
171170
check_function_exists(posix_memalign HAVE_POSIX_MEMALIGN)
@@ -238,7 +237,7 @@ cmake_dependent_option(OPENSCAP_PROBE_INDEPENDENT_TEXTFILECONTENT "Independent t
238237
cmake_dependent_option(OPENSCAP_PROBE_INDEPENDENT_TEXTFILECONTENT54 "Independent textfilecontent54 probe" ON "ENABLE_PROBES_INDEPENDENT; NOT WIN32" OFF)
239238
cmake_dependent_option(OPENSCAP_PROBE_INDEPENDENT_VARIABLE "Independent variable probe" ON "ENABLE_PROBES_INDEPENDENT" OFF)
240239
cmake_dependent_option(OPENSCAP_PROBE_INDEPENDENT_XMLFILECONTENT "Independent xmlfilecontent probe" ON "ENABLE_PROBES_INDEPENDENT; NOT WIN32" OFF)
241-
cmake_dependent_option(OPENSCAP_PROBE_INDEPENDENT_YAMLFILECONTENT "Independent yamlfilecontent probe" ON "ENABLE_PROBES_INDEPENDENT; LIBYAML_FOUND; YAMLPATH_FOUND; NOT WIN32" OFF)
240+
cmake_dependent_option(OPENSCAP_PROBE_INDEPENDENT_YAMLFILECONTENT "Independent yamlfilecontent probe" ON "ENABLE_PROBES_INDEPENDENT; LIBYAML_FOUND; NOT WIN32" OFF)
242241

243242
# UNIX PROBES
244243
cmake_dependent_option(OPENSCAP_PROBE_UNIX_DNSCACHE "Unix dnscache probe" ON "ENABLE_PROBES_UNIX" OFF)
@@ -531,6 +530,7 @@ include_directories(
531530
"src/XCCDF/public/"
532531
"src/XCCDF_POLICY/"
533532
"src/XCCDF_POLICY/public/"
533+
"yaml-filter"
534534
${CMAKE_BINARY_DIR} # config.h is generated to build directory
535535
${LIBXML2_INCLUDE_DIR}
536536
)
@@ -553,6 +553,11 @@ function(set_oscap_generic_properties TARGET_OBJECT)
553553
target_compile_definitions(${TARGET_OBJECT} PRIVATE OSCAP_BUILD_SHARED)
554554
endfunction()
555555

556+
if(OPENSCAP_PROBE_INDEPENDENT_YAMLFILECONTENT)
557+
add_library(yamlfilter_object OBJECT yaml-filter/yaml-path.c yaml-filter/yaml-path.h)
558+
set_oscap_generic_properties(yamlfilter_object)
559+
endif()
560+
556561
add_subdirectory("compat")
557562
add_subdirectory("src")
558563
add_subdirectory("utils")

cmake/FindYamlpath.cmake

Lines changed: 0 additions & 29 deletions
This file was deleted.

docs/developer/developer.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ mkdir -p build
3131
.. Use fresh sources from git repository.
3232
+
3333
----
34-
$ git clone https://github.com/OpenSCAP/openscap.git
34+
$ git clone --recurse-submodules https://github.com/OpenSCAP/openscap.git
3535
$ cd openscap
3636
----
3737
+

release_tools/README.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
. Clone a clean `openscap` repository:
1111

12-
git clone https://github.com/OpenSCAP/openscap.git
12+
git clone --recurse-submodules https://github.com/OpenSCAP/openscap.git
1313

1414
. Create `.env` file
1515
+

release_tools/release.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ make_dist()
101101
check_abi()
102102
{
103103
rpm -q abi-compliance-checker || sudo dnf install abi-compliance-checker
104-
test -d openscap-abi-check || git clone [email protected]:OpenSCAP/openscap-abi-check.git
104+
test -d openscap-abi-check || git clone --recurse-submodules [email protected]:OpenSCAP/openscap-abi-check.git
105105
openscap_git_branch=$(git branch | grep '^\* ' | cut -f2 -d' ')
106106
(
107107
cd openscap-abi-check

src/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ set(OBJECTS_TO_LINK_AGAINST
3131
if (TARGET "compat_object")
3232
list(APPEND OBJECTS_TO_LINK_AGAINST $<TARGET_OBJECTS:compat_object>)
3333
endif()
34+
if (TARGET "yamlfilter_object")
35+
list(APPEND OBJECTS_TO_LINK_AGAINST $<TARGET_OBJECTS:yamlfilter_object>)
36+
endif()
3437
if (ENABLE_PROBES)
3538
list(APPEND OBJECTS_TO_LINK_AGAINST
3639
$<TARGET_OBJECTS:probe_object>
@@ -124,9 +127,6 @@ endif()
124127
if(LIBYAML_FOUND)
125128
target_link_libraries(openscap ${LIBYAML_LIBRARIES})
126129
endif()
127-
if(YAMLPATH_FOUND)
128-
target_link_libraries(openscap ${YAMLPATH_LIBRARIES})
129-
endif()
130130

131131
if(WIN32)
132132
set(OPENSCAP_INSTALL_DESTINATION ".")

0 commit comments

Comments
 (0)