Files
ArduinoJson/CMakeLists.txt

48 lines
1.0 KiB
CMake
Raw Normal View History

# ArduinoJson - arduinojson.org
2020-01-09 15:48:38 +01:00
# Copyright Benoit Blanchon 2014-2020
# MIT License
cmake_minimum_required(VERSION 3.0)
project(ArduinoJson VERSION 6.15.1)
2014-10-14 09:51:23 +02:00
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
include(CTest)
endif()
add_subdirectory(src)
2014-10-14 09:51:23 +02:00
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING)
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.8)
add_compile_options(-g -Og)
else()
add_compile_options(-g -O0)
endif()
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.0)
add_compile_options(-g -Og)
else()
add_compile_options(-g -O0)
endif()
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 9.0)
add_compile_options(-g -Og)
else()
add_compile_options(-g -O0)
endif()
endif()
2014-11-30 15:11:19 +01:00
if(${COVERAGE})
set(CMAKE_CXX_FLAGS "-fprofile-arcs -ftest-coverage")
endif()
add_subdirectory(extras/tests)
add_subdirectory(extras/fuzzing)
endif()