2017-11-07 20:42:50 +01:00
|
|
|
# ArduinoJson - arduinojson.org
|
2019-02-15 13:31:46 +01:00
|
|
|
# Copyright Benoit Blanchon 2014-2019
|
2016-01-07 22:35:12 +01:00
|
|
|
# MIT License
|
|
|
|
|
2016-06-22 21:41:19 +02:00
|
|
|
if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)")
|
|
|
|
add_compile_options(
|
|
|
|
-pedantic
|
|
|
|
-Wall
|
|
|
|
-Wcast-align
|
|
|
|
-Wcast-qual
|
|
|
|
-Wconversion
|
|
|
|
-Wctor-dtor-privacy
|
|
|
|
-Wdisabled-optimization
|
|
|
|
-Werror
|
|
|
|
-Wextra
|
|
|
|
-Wformat=2
|
|
|
|
-Winit-self
|
|
|
|
-Wmissing-include-dirs
|
|
|
|
-Wnon-virtual-dtor
|
|
|
|
-Wold-style-cast
|
|
|
|
-Woverloaded-virtual
|
2017-07-09 15:24:58 +02:00
|
|
|
-Wparentheses
|
2016-06-22 21:41:19 +02:00
|
|
|
-Wredundant-decls
|
|
|
|
-Wshadow
|
|
|
|
-Wsign-promo
|
2017-07-09 15:24:58 +02:00
|
|
|
-Wstrict-aliasing
|
2016-06-22 21:41:19 +02:00
|
|
|
-Wstrict-overflow=5
|
|
|
|
-Wundef
|
|
|
|
)
|
2017-05-04 21:58:28 +02:00
|
|
|
|
|
|
|
if(NOT MINGW)
|
|
|
|
add_compile_options(
|
|
|
|
-std=c++98
|
|
|
|
)
|
|
|
|
endif()
|
2016-06-22 21:41:19 +02:00
|
|
|
endif()
|
2014-10-16 16:23:24 +02:00
|
|
|
|
2016-06-22 21:41:19 +02:00
|
|
|
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
|
|
|
add_compile_options(
|
|
|
|
-Wstrict-null-sentinel
|
2018-08-22 14:37:17 +02:00
|
|
|
-Wno-vla # Allow VLA in tests
|
2016-06-22 21:41:19 +02:00
|
|
|
)
|
2018-08-22 14:37:17 +02:00
|
|
|
add_definitions(-DHAS_VARIABLE_LENGTH_ARRAY)
|
2014-11-15 15:09:48 +01:00
|
|
|
|
2016-06-22 21:41:19 +02:00
|
|
|
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.5)
|
|
|
|
add_compile_options(-Wlogical-op) # the flag exists in 4.4 but is buggy
|
|
|
|
endif()
|
2016-02-14 16:18:13 +01:00
|
|
|
|
2016-06-22 21:41:19 +02:00
|
|
|
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.6)
|
|
|
|
add_compile_options(-Wnoexcept)
|
|
|
|
endif()
|
2015-08-27 21:47:49 +02:00
|
|
|
endif()
|
|
|
|
|
2016-06-22 21:41:19 +02:00
|
|
|
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
|
|
|
add_compile_options(
|
|
|
|
-Wc++11-compat
|
|
|
|
-Wdeprecated-register
|
2018-08-22 14:37:17 +02:00
|
|
|
-Wno-vla-extension # Allow VLA in tests
|
|
|
|
)
|
|
|
|
add_definitions(
|
|
|
|
-DHAS_VARIABLE_LENGTH_ARRAY
|
|
|
|
-DSUBSCRIPT_CONFLICTS_WITH_BUILTIN_OPERATOR
|
2016-06-22 21:41:19 +02:00
|
|
|
)
|
|
|
|
endif()
|
2014-10-16 16:23:24 +02:00
|
|
|
|
2016-06-22 21:41:19 +02:00
|
|
|
if(MSVC)
|
|
|
|
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
2016-09-19 10:08:14 +02:00
|
|
|
add_compile_options(
|
|
|
|
/W4 # Set warning level
|
|
|
|
/WX # Treats all compiler warnings as errors.
|
|
|
|
)
|
2016-06-22 21:41:19 +02:00
|
|
|
endif()
|
2016-02-14 16:18:13 +01:00
|
|
|
|
2019-01-29 14:09:09 +01:00
|
|
|
add_subdirectory(ElementProxy)
|
2017-04-10 15:36:59 +02:00
|
|
|
add_subdirectory(IntegrationTests)
|
|
|
|
add_subdirectory(JsonArray)
|
2018-04-17 21:27:45 +02:00
|
|
|
add_subdirectory(JsonDeserializer)
|
2018-08-21 17:56:16 +02:00
|
|
|
add_subdirectory(JsonDocument)
|
2018-07-04 11:57:30 +02:00
|
|
|
add_subdirectory(JsonObject)
|
2018-03-01 09:24:58 +01:00
|
|
|
add_subdirectory(JsonSerializer)
|
2017-04-10 15:36:59 +02:00
|
|
|
add_subdirectory(JsonVariant)
|
2019-01-29 14:09:09 +01:00
|
|
|
add_subdirectory(MemberProxy)
|
2018-11-16 10:26:59 +01:00
|
|
|
add_subdirectory(MemoryPool)
|
2017-04-10 15:36:59 +02:00
|
|
|
add_subdirectory(Misc)
|
2018-11-16 10:26:59 +01:00
|
|
|
add_subdirectory(MixedConfiguration)
|
2018-05-29 08:31:17 +02:00
|
|
|
add_subdirectory(MsgPackDeserializer)
|
|
|
|
add_subdirectory(MsgPackSerializer)
|
2018-07-04 11:57:30 +02:00
|
|
|
add_subdirectory(Numbers)
|
2019-01-29 14:09:09 +01:00
|
|
|
add_subdirectory(TextFormatter)
|