Commit 72e0f42d authored by Vincent Pinon's avatar Vincent Pinon Committed by Vincent Pinon

Fix fuzzing build

parent ecd97df6
Pipeline #22746 passed with stage
in 25 minutes and 46 seconds
......@@ -52,7 +52,7 @@ find_package(KF5 REQUIRED COMPONENTS Archive Bookmarks CoreAddons Config ConfigW
set(QT_MIN_VERSION 5.11.0)
find_package(Qt5 REQUIRED COMPONENTS Core DBus Widgets Svg Quick QuickControls2 Concurrent QuickWidgets Multimedia)
add_definitions(-DQT_NO_CAST_TO_ASCII -DQT_NO_URL_CAST_FROM_STRING)
set(DEFAULT_CXX_FLAGS "${DEFAULT_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
# MLT
find_package(MLT ${MLT_MIN_VERSION} REQUIRED)
......@@ -120,12 +120,8 @@ set(FFMPEG_SUFFIX "" CACHE STRING "FFmpeg custom suffix")
configure_file(config-kdenlive.h.cmake config-kdenlive.h @ONLY)
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unknown-warning-option")
endif()
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-suggest-override")
set(KDENLIVE_CXX_FLAGS "${DEFAULT_CXX_FLAGS} -Wall -pedantic -Wextra")
if(BUILD_FUZZING)
set(ECM_ENABLE_SANITIZERS fuzzer;address)
endif()
# Sources
......
include_directories(${MLT_INCLUDE_DIR})
kde_enable_exceptions()
add_executable(fuzz main_fuzzer.cpp fuzzing.cpp)
add_executable(fuzz_reproduce main_reproducer.cpp fuzzing.cpp)
target_link_libraries(fuzz kdenliveLib)
target_link_libraries(fuzz kdenliveLib -fsanitize=fuzzer)
target_link_libraries(fuzz_reproduce kdenliveLib)
set_property(TARGET fuzz PROPERTY CXX_STANDARD 14)
set_property(TARGET fuzz_reproduce PROPERTY CXX_STANDARD 14)
set_target_properties(fuzz PROPERTIES COMPILE_FLAGS "-O1 -g -Wall -pedantic -Wextra -fexceptions -fsanitize=fuzzer,address")
set_target_properties(fuzz PROPERTIES LINK_FLAGS "-fsanitize=fuzzer")
# Create a static library from kiss_fft
find_package(Qt5Core REQUIRED)
include_directories(
${CMAKE_BINARY_DIR}
)
add_library(kiss_fft STATIC
_kiss_fft_guts.h
kiss_fft.c
tools/kiss_fftr.c
)
include_directories(${CMAKE_BINARY_DIR})
add_library(kiss_fft STATIC _kiss_fft_guts.h kiss_fft.c tools/kiss_fftr.c)
set_property(TARGET kiss_fft PROPERTY C_STANDARD 99)
target_link_libraries(kiss_fft Qt5::Core)
if(HAVE_LINUX_INPUT_H)
# Create a static library media_ctrl
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --std=c99")
include_directories(
${CMAKE_BINARY_DIR}
)
add_library(media_ctrl STATIC
mediactrl.c
)
include_directories(${CMAKE_BINARY_DIR})
add_library(media_ctrl STATIC mediactrl.c)
set_property(TARGET media_ctrl PROPERTY C_STANDARD 99)
endif()
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions")
endif()
set(Tests_SRCS
include_directories(${MLT_INCLUDE_DIR} ..)
kde_enable_exceptions()
add_executable(runTests
TestMain.cpp
abortutil.cpp
compositiontest.cpp
......@@ -17,8 +16,6 @@ set(Tests_SRCS
treetest.cpp
trimmingtest.cpp
)
include_directories(${MLT_INCLUDE_DIR} ..)
add_executable(runTests ${Tests_SRCS})
set_property(TARGET runTests PROPERTY CXX_STANDARD 14)
target_link_libraries(runTests kdenliveLib)
add_test(NAME runTests COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/runTests -d yes)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment