diff --git a/CMakeLists.txt b/CMakeLists.txt index a5371f8..845f786 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -154,9 +154,11 @@ if(BUILD_TESTING) file(GLOB CORPUS_TESTS ${CMAKE_SOURCE_DIR}/corpus/*) add_executable(fuzz_driver ConflictSet.cpp FuzzTestDriver.cpp) - target_compile_options(fuzz_driver PRIVATE ${TEST_FLAGS} - -fsanitize=address,undefined) - target_link_options(fuzz_driver PRIVATE -fsanitize=address,undefined) + target_compile_options(fuzz_driver PRIVATE ${TEST_FLAGS}) + if(NOT CMAKE_CROSSCOMPILING) + target_compile_options(fuzz_driver PRIVATE -fsanitize=address,undefined) + target_link_options(fuzz_driver PRIVATE -fsanitize=address,undefined) + endif() target_compile_definitions(fuzz_driver PRIVATE ENABLE_FUZZ) target_include_directories(fuzz_driver PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include)