diff options
author | Robert Löhning <robert.loehning@qt.io> | 2021-05-27 21:29:39 +0200 |
---|---|---|
committer | Robert Löhning <robert.loehning@qt.io> | 2021-05-31 16:44:06 +0200 |
commit | 8b691ce24572f4709213d880c478e444feafe3fb (patch) | |
tree | aff91156cf5d1a9f7bd2eb6fc062455e864b03f8 /tests/libfuzzer/gui/text | |
parent | 4b0b87b5c2173ee70eacfdd7cea08aea8a5164c8 (diff) |
Fuzzing: Add CMake project files for fuzz targets
Change-Id: Ied44bfd2c83d5590066146187a7333b677ceb179
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'tests/libfuzzer/gui/text')
3 files changed, 75 insertions, 66 deletions
diff --git a/tests/libfuzzer/gui/text/qtextdocument/sethtml/CMakeLists.txt b/tests/libfuzzer/gui/text/qtextdocument/sethtml/CMakeLists.txt index 1fefea0128..d4777c1096 100644 --- a/tests/libfuzzer/gui/text/qtextdocument/sethtml/CMakeLists.txt +++ b/tests/libfuzzer/gui/text/qtextdocument/sethtml/CMakeLists.txt @@ -1,30 +1,33 @@ -# Generated from sethtml.pro. +cmake_minimum_required(VERSION 3.14) +project(sethtml LANGUAGES CXX) -##################################################################### -## sethtml Binary: -##################################################################### +set(CMAKE_INCLUDE_CURRENT_DIR ON) -qt_internal_add_executable(sethtml - GUI - SOURCES - main.cpp - PUBLIC_LIBRARIES - Qt::Gui -) - -#### Keys ignored in scope 1:.:.:sethtml.pro:<TRUE>: -# FUZZ_ENGINE = "$$(LIB_FUZZING_ENGINE)" -# QTPLUGIN = "qminimal" +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) -## Scopes: -##################################################################### +find_package(Qt6 COMPONENTS Core) +find_package(Qt6 COMPONENTS Gui) -qt_internal_extend_target(sethtml CONDITION FUZZ_ENGINE_ISEMPTY - LINK_OPTIONS - "-fsanitize=fuzzer" +qt_add_executable(sethtml + main.cpp ) -qt_internal_extend_target(sethtml CONDITION NOT FUZZ_ENGINE_ISEMPTY - PUBLIC_LIBRARIES +target_link_libraries(sethtml PUBLIC + Qt::Core + Qt::Gui +) +if(DEFINED ENV{LIB_FUZZING_ENGINE}) + target_link_libraries(sethtml PRIVATE $ENV{LIB_FUZZING_ENGINE} + ) +else() + target_link_libraries(sethtml PRIVATE + -fsanitize=fuzzer + ) +endif() + +qt_import_plugins(sethtml + INCLUDE Qt::QMinimalIntegrationPlugin ) diff --git a/tests/libfuzzer/gui/text/qtextdocument/setmarkdown/CMakeLists.txt b/tests/libfuzzer/gui/text/qtextdocument/setmarkdown/CMakeLists.txt index acc678f2ef..2d1d45ed86 100644 --- a/tests/libfuzzer/gui/text/qtextdocument/setmarkdown/CMakeLists.txt +++ b/tests/libfuzzer/gui/text/qtextdocument/setmarkdown/CMakeLists.txt @@ -1,30 +1,33 @@ -# Generated from setmarkdown.pro. +cmake_minimum_required(VERSION 3.14) +project(setmarkdown LANGUAGES CXX) -##################################################################### -## setmarkdown Binary: -##################################################################### +set(CMAKE_INCLUDE_CURRENT_DIR ON) -qt_internal_add_executable(setmarkdown - GUI - SOURCES - main.cpp - PUBLIC_LIBRARIES - Qt::Gui -) - -#### Keys ignored in scope 1:.:.:setmarkdown.pro:<TRUE>: -# FUZZ_ENGINE = "$$(LIB_FUZZING_ENGINE)" -# QTPLUGIN = "qminimal" +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) -## Scopes: -##################################################################### +find_package(Qt6 COMPONENTS Core) +find_package(Qt6 COMPONENTS Gui) -qt_internal_extend_target(setmarkdown CONDITION FUZZ_ENGINE_ISEMPTY - LINK_OPTIONS - "-fsanitize=fuzzer" +qt_add_executable(setmarkdown + main.cpp ) -qt_internal_extend_target(setmarkdown CONDITION NOT FUZZ_ENGINE_ISEMPTY - PUBLIC_LIBRARIES +target_link_libraries(setmarkdown PUBLIC + Qt::Core + Qt::Gui +) +if(DEFINED ENV{LIB_FUZZING_ENGINE}) + target_link_libraries(setmarkdown PRIVATE $ENV{LIB_FUZZING_ENGINE} + ) +else() + target_link_libraries(setmarkdown PRIVATE + -fsanitize=fuzzer + ) +endif() + +qt_import_plugins(setmarkdown + INCLUDE Qt::QMinimalIntegrationPlugin ) diff --git a/tests/libfuzzer/gui/text/qtextlayout/beginlayout/CMakeLists.txt b/tests/libfuzzer/gui/text/qtextlayout/beginlayout/CMakeLists.txt index 637ce2f51b..4a593d328a 100644 --- a/tests/libfuzzer/gui/text/qtextlayout/beginlayout/CMakeLists.txt +++ b/tests/libfuzzer/gui/text/qtextlayout/beginlayout/CMakeLists.txt @@ -1,30 +1,33 @@ -# Generated from beginlayout.pro. +cmake_minimum_required(VERSION 3.14) +project(beginlayout LANGUAGES CXX) -##################################################################### -## beginlayout Binary: -##################################################################### +set(CMAKE_INCLUDE_CURRENT_DIR ON) -qt_internal_add_executable(beginlayout - GUI - SOURCES - main.cpp - PUBLIC_LIBRARIES - Qt::Gui -) - -#### Keys ignored in scope 1:.:.:beginlayout.pro:<TRUE>: -# FUZZ_ENGINE = "$$(LIB_FUZZING_ENGINE)" -# QTPLUGIN = "qminimal" +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) -## Scopes: -##################################################################### +find_package(Qt6 COMPONENTS Core) +find_package(Qt6 COMPONENTS Gui) -qt_internal_extend_target(beginlayout CONDITION FUZZ_ENGINE_ISEMPTY - LINK_OPTIONS - "-fsanitize=fuzzer" +qt_add_executable(beginlayout + main.cpp ) -qt_internal_extend_target(beginlayout CONDITION NOT FUZZ_ENGINE_ISEMPTY - PUBLIC_LIBRARIES +target_link_libraries(beginlayout PUBLIC + Qt::Core + Qt::Gui +) +if(DEFINED ENV{LIB_FUZZING_ENGINE}) + target_link_libraries(beginlayout PRIVATE $ENV{LIB_FUZZING_ENGINE} + ) +else() + target_link_libraries(beginlayout PRIVATE + -fsanitize=fuzzer + ) +endif() + +qt_import_plugins(beginlayout + INCLUDE Qt::QMinimalIntegrationPlugin ) |