diff --git a/projects/qpid-proton/Dockerfile b/projects/qpid-proton/Dockerfile index 0c2e6eada..37f5e306c 100644 --- a/projects/qpid-proton/Dockerfile +++ b/projects/qpid-proton/Dockerfile @@ -25,4 +25,3 @@ RUN git clone git://git.apache.org/qpid-proton.git WORKDIR qpid-proton COPY build.sh $SRC/ COPY c_tests_fuzz_CMakeLists.patch $SRC/ -COPY c_CMakeLists.patch $SRC/ diff --git a/projects/qpid-proton/build.sh b/projects/qpid-proton/build.sh index ba7e1ff98..62e51e4b6 100755 --- a/projects/qpid-proton/build.sh +++ b/projects/qpid-proton/build.sh @@ -15,11 +15,10 @@ # ################################################################################ -patch -p1 < $SRC/c_tests_fuzz_CMakeLists.patch -patch -p1 < $SRC/c_CMakeLists.patch +patch -p1 < $SRC/c_tests_fuzz_CMakeLists.patch || (cat c/tests/fuzz/CMakeLists.txt.rej && false) mkdir build pushd build - cmake .. -DCMAKE_BUILD_TYPE=Release -DENABLE_FUZZ_TESTING=ON -DFUZZ_REGRESSION_TESTS=OFF + cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_STATIC_LIBS=ON -DENABLE_FUZZ_TESTING=ON -DFUZZ_REGRESSION_TESTS=OFF pushd c/tests/fuzz/ make -j $(nproc) popd diff --git a/projects/qpid-proton/c_CMakeLists.patch b/projects/qpid-proton/c_CMakeLists.patch deleted file mode 100644 index 5b186de4f..000000000 --- a/projects/qpid-proton/c_CMakeLists.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/c/CMakeLists.txt b/c/CMakeLists.txt -index 40b50374..2247e0f1 100644 ---- a/c/CMakeLists.txt -+++ b/c/CMakeLists.txt -@@ -539,7 +539,7 @@ if (BUILD_WITH_CXX) - endif (BUILD_WITH_CXX) - - add_library ( -- qpid-proton-core SHARED -+ qpid-proton-core STATIC - ${qpid-proton-core} - ${qpid-proton-layers} - ${qpid-proton-platform} diff --git a/projects/qpid-proton/c_tests_fuzz_CMakeLists.patch b/projects/qpid-proton/c_tests_fuzz_CMakeLists.patch index 140789b32..759ed9dcf 100644 --- a/projects/qpid-proton/c_tests_fuzz_CMakeLists.patch +++ b/projects/qpid-proton/c_tests_fuzz_CMakeLists.patch @@ -1,11 +1,19 @@ diff --git a/c/tests/fuzz/CMakeLists.txt b/c/tests/fuzz/CMakeLists.txt -index f870d617..054ec6d6 100644 +index f870d617..c9d46168 100644 --- a/c/tests/fuzz/CMakeLists.txt +++ b/c/tests/fuzz/CMakeLists.txt -@@ -33,6 +33,8 @@ add_library (StandaloneFuzzTargetMain STATIC StandaloneFuzzTargetMain.c Standalo +@@ -32,7 +32,15 @@ add_library (StandaloneFuzzTargetMain STATIC StandaloneFuzzTargetMain.c Standalo + macro (pn_add_fuzz_test test) add_executable (${test} ${ARGN}) - target_link_libraries (${test} qpid-proton-core ${FUZZING_LIBRARY}) +- target_link_libraries (${test} qpid-proton-core ${FUZZING_LIBRARY}) ++ # prefer static lib for the fuzzer, if available ++ if (BUILD_STATIC_LIBS) ++ set(FUZZING_QPID_PROTON_CORE_LIBRARY qpid-proton-core-static) ++ else() ++ set(FUZZING_QPID_PROTON_CORE_LIBRARY qpid-proton-core) ++ endif() ++ target_link_libraries (${test} ${FUZZING_QPID_PROTON_CORE_LIBRARY} ${FUZZING_LIBRARY}) + # -lFuzzingEngine is a C++ library, which needs c++ std lib + set_target_properties(${test} PROPERTIES LINKER_LANGUAGE CXX)