forked from bblanchon/ArduinoJson
Reformat CMake files
This commit is contained in:
@ -27,11 +27,10 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)")
|
||||
if(${COVERAGE})
|
||||
set(CMAKE_CXX_FLAGS "-fprofile-arcs -ftest-coverage")
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
if((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.8) AND (NOT ${COVERAGE}))
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
if((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.8) AND(NOT ${COVERAGE}))
|
||||
add_compile_options(-g -Og)
|
||||
else()
|
||||
add_compile_options(-g -O0)
|
||||
@ -65,7 +64,7 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
endif()
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
if((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.0) AND (NOT ${COVERAGE}))
|
||||
if((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.0) AND(NOT ${COVERAGE}))
|
||||
add_compile_options(-g -Og)
|
||||
else()
|
||||
add_compile_options(-g -O0)
|
||||
@ -73,7 +72,7 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
endif()
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
|
||||
if((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 9.0) AND (NOT ${COVERAGE}))
|
||||
if((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 9.0) AND(NOT ${COVERAGE}))
|
||||
add_compile_options(-g -Og)
|
||||
else()
|
||||
add_compile_options(-g -O0)
|
||||
@ -90,7 +89,7 @@ if(MSVC)
|
||||
endif()
|
||||
|
||||
if(MINGW)
|
||||
# Static link on MinGW to avoid linking with the wrong DLLs when multiple
|
||||
# Static link on MinGW to avoid linking with the wrong DLLs when multiple
|
||||
# versions are installed.
|
||||
add_link_options(-static)
|
||||
endif()
|
||||
|
@ -2,5 +2,7 @@
|
||||
# Copyright © 2014-2022, Benoit BLANCHON
|
||||
# MIT License
|
||||
|
||||
idf_component_register(SRCS "main.cpp"
|
||||
INCLUDE_DIRS "")
|
||||
idf_component_register(
|
||||
SRCS "main.cpp"
|
||||
INCLUDE_DIRS ""
|
||||
)
|
||||
|
@ -22,7 +22,7 @@ target_link_libraries(json_reproducer
|
||||
ArduinoJson
|
||||
)
|
||||
|
||||
macro(add_fuzzer name)
|
||||
macro(add_fuzzer name)
|
||||
set(FUZZER "${name}_fuzzer")
|
||||
set(CORPUS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/${name}_corpus")
|
||||
set(SEED_CORPUS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/${name}_seed_corpus")
|
||||
@ -33,27 +33,23 @@ macro(add_fuzzer name)
|
||||
ArduinoJson
|
||||
)
|
||||
set_target_properties("${FUZZER}"
|
||||
PROPERTIES
|
||||
COMPILE_FLAGS
|
||||
"-fprofile-instr-generate -fcoverage-mapping -fsanitize=fuzzer -fno-sanitize-recover=all"
|
||||
LINK_FLAGS
|
||||
"-fprofile-instr-generate -fcoverage-mapping -fsanitize=fuzzer -fno-sanitize-recover=all"
|
||||
PROPERTIES
|
||||
COMPILE_FLAGS "-fprofile-instr-generate -fcoverage-mapping -fsanitize=fuzzer -fno-sanitize-recover=all"
|
||||
LINK_FLAGS "-fprofile-instr-generate -fcoverage-mapping -fsanitize=fuzzer -fno-sanitize-recover=all"
|
||||
)
|
||||
|
||||
add_test(
|
||||
NAME
|
||||
"${FUZZER}"
|
||||
COMMAND
|
||||
"${FUZZER}" "${CORPUS_DIR}" "${SEED_CORPUS_DIR}" -max_total_time=5 -timeout=1
|
||||
NAME "${FUZZER}"
|
||||
COMMAND "${FUZZER}" "${CORPUS_DIR}" "${SEED_CORPUS_DIR}" -max_total_time=5 -timeout=1
|
||||
)
|
||||
|
||||
set_tests_properties("${FUZZER}"
|
||||
PROPERTIES
|
||||
LABELS "Fuzzing"
|
||||
LABELS "Fuzzing"
|
||||
)
|
||||
endmacro()
|
||||
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 6)
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 6)
|
||||
add_fuzzer(json)
|
||||
add_fuzzer(msgpack)
|
||||
endif()
|
||||
|
@ -25,5 +25,5 @@ add_test(Cpp17 Cpp17Tests)
|
||||
|
||||
set_tests_properties(Cpp17
|
||||
PROPERTIES
|
||||
LABELS "Catch"
|
||||
LABELS "Catch"
|
||||
)
|
||||
|
@ -25,5 +25,5 @@ add_test(Cpp20 Cpp20Tests)
|
||||
|
||||
set_tests_properties(Cpp20
|
||||
PROPERTIES
|
||||
LABELS "Catch"
|
||||
LABELS "Catch"
|
||||
)
|
||||
|
@ -5,25 +5,21 @@
|
||||
macro(build_should_fail target)
|
||||
set_target_properties(${target}
|
||||
PROPERTIES
|
||||
EXCLUDE_FROM_ALL TRUE
|
||||
EXCLUDE_FROM_DEFAULT_BUILD TRUE
|
||||
EXCLUDE_FROM_ALL TRUE
|
||||
EXCLUDE_FROM_DEFAULT_BUILD TRUE
|
||||
)
|
||||
add_test(
|
||||
NAME
|
||||
${target}
|
||||
COMMAND
|
||||
${CMAKE_COMMAND} --build . --target ${target} --config $<CONFIGURATION>
|
||||
WORKING_DIRECTORY
|
||||
${CMAKE_BINARY_DIR}
|
||||
NAME ${target}
|
||||
COMMAND ${CMAKE_COMMAND} --build . --target ${target} --config $<CONFIGURATION>
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
)
|
||||
set_tests_properties(${target}
|
||||
set_tests_properties(${target}
|
||||
PROPERTIES
|
||||
WILL_FAIL TRUE
|
||||
LABELS "WillFail;Catch"
|
||||
WILL_FAIL TRUE
|
||||
LABELS "WillFail;Catch"
|
||||
)
|
||||
endmacro()
|
||||
|
||||
|
||||
add_executable(Issue978 Issue978.cpp)
|
||||
build_should_fail(Issue978)
|
||||
|
||||
|
@ -12,7 +12,7 @@ add_executable(IntegrationTests
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
||||
target_compile_options(IntegrationTests
|
||||
PUBLIC
|
||||
-fsingle-precision-constant # issue 544
|
||||
-fsingle-precision-constant # issue 544
|
||||
)
|
||||
endif()
|
||||
|
||||
@ -20,5 +20,5 @@ add_test(IntegrationTests IntegrationTests)
|
||||
|
||||
set_tests_properties(IntegrationTests
|
||||
PROPERTIES
|
||||
LABELS "Catch"
|
||||
LABELS "Catch"
|
||||
)
|
||||
|
@ -24,5 +24,5 @@ add_test(JsonArray JsonArrayTests)
|
||||
|
||||
set_tests_properties(JsonArray
|
||||
PROPERTIES
|
||||
LABELS "Catch"
|
||||
LABELS "Catch"
|
||||
)
|
||||
|
@ -24,5 +24,5 @@ add_test(JsonDeserializer JsonDeserializerTests)
|
||||
|
||||
set_tests_properties(JsonDeserializer
|
||||
PROPERTIES
|
||||
LABELS "Catch"
|
||||
LABELS "Catch"
|
||||
)
|
||||
|
@ -28,5 +28,5 @@ add_test(JsonDocument JsonDocumentTests)
|
||||
|
||||
set_tests_properties(JsonDocument
|
||||
PROPERTIES
|
||||
LABELS "Catch"
|
||||
LABELS "Catch"
|
||||
)
|
||||
|
@ -25,5 +25,5 @@ add_test(JsonObject JsonObjectTests)
|
||||
|
||||
set_tests_properties(JsonObject
|
||||
PROPERTIES
|
||||
LABELS "Catch"
|
||||
LABELS "Catch"
|
||||
)
|
||||
|
@ -18,5 +18,5 @@ add_test(JsonSerializer JsonSerializerTests)
|
||||
|
||||
set_tests_properties(JsonSerializer
|
||||
PROPERTIES
|
||||
LABELS "Catch"
|
||||
LABELS "Catch"
|
||||
)
|
||||
|
@ -33,5 +33,5 @@ add_test(JsonVariant JsonVariantTests)
|
||||
|
||||
set_tests_properties(JsonVariant
|
||||
PROPERTIES
|
||||
LABELS "Catch"
|
||||
LABELS "Catch"
|
||||
)
|
||||
|
@ -2,7 +2,7 @@
|
||||
# Copyright © 2014-2022, Benoit BLANCHON
|
||||
# MIT License
|
||||
|
||||
add_executable(MemoryPoolTests
|
||||
add_executable(MemoryPoolTests
|
||||
allocVariant.cpp
|
||||
clear.cpp
|
||||
saveString.cpp
|
||||
@ -14,5 +14,5 @@ add_test(MemoryPool MemoryPoolTests)
|
||||
|
||||
set_tests_properties(MemoryPool
|
||||
PROPERTIES
|
||||
LABELS "Catch"
|
||||
LABELS "Catch"
|
||||
)
|
||||
|
@ -25,5 +25,5 @@ add_test(Misc MiscTests)
|
||||
|
||||
set_tests_properties(Misc
|
||||
PROPERTIES
|
||||
LABELS "Catch"
|
||||
LABELS "Catch"
|
||||
)
|
||||
|
@ -29,5 +29,5 @@ add_test(MixedConfiguration MixedConfigurationTests)
|
||||
|
||||
set_tests_properties(MixedConfiguration
|
||||
PROPERTIES
|
||||
LABELS "Catch"
|
||||
LABELS "Catch"
|
||||
)
|
||||
|
@ -20,5 +20,5 @@ add_test(MsgPackDeserializer MsgPackDeserializerTests)
|
||||
|
||||
set_tests_properties(MsgPackDeserializer
|
||||
PROPERTIES
|
||||
LABELS "Catch"
|
||||
LABELS "Catch"
|
||||
)
|
||||
|
@ -15,5 +15,5 @@ add_test(MsgPackSerializer MsgPackSerializerTests)
|
||||
|
||||
set_tests_properties(MsgPackSerializer
|
||||
PROPERTIES
|
||||
LABELS "Catch"
|
||||
LABELS "Catch"
|
||||
)
|
||||
|
@ -10,10 +10,9 @@ add_executable(NumbersTests
|
||||
parseNumber.cpp
|
||||
)
|
||||
|
||||
|
||||
add_test(Numbers NumbersTests)
|
||||
|
||||
set_tests_properties(Numbers
|
||||
PROPERTIES
|
||||
LABELS "Catch"
|
||||
LABELS "Catch"
|
||||
)
|
||||
|
@ -2,7 +2,7 @@
|
||||
# Copyright © 2014-2022, Benoit BLANCHON
|
||||
# MIT License
|
||||
|
||||
add_executable(TextFormatterTests
|
||||
add_executable(TextFormatterTests
|
||||
writeFloat.cpp
|
||||
writeInteger.cpp
|
||||
writeString.cpp
|
||||
@ -14,5 +14,5 @@ add_test(TextFormatter TextFormatterTests)
|
||||
|
||||
set_tests_properties(TextFormatter
|
||||
PROPERTIES
|
||||
LABELS "Catch"
|
||||
LABELS "Catch"
|
||||
)
|
||||
|
@ -12,7 +12,7 @@ add_library(catch
|
||||
|
||||
target_include_directories(catch
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
if(MINGW)
|
||||
|
Reference in New Issue
Block a user