Rev | Line | |
---|
[209] | 1 | # Copyright Benoit Blanchon 2014-2016
|
---|
| 2 | # MIT License
|
---|
| 3 | #
|
---|
| 4 | # Arduino JSON library
|
---|
| 5 | # https://github.com/bblanchon/ArduinoJson
|
---|
| 6 | # If you like this project, please add a star!
|
---|
| 7 |
|
---|
| 8 | file(GLOB_RECURSE HPP_FILES ../include/*.hpp)
|
---|
| 9 | file(GLOB_RECURSE IPP_FILES ../include/*.ipp)
|
---|
| 10 | file(GLOB_RECURSE CPP_FILES *.cpp)
|
---|
| 11 |
|
---|
| 12 | if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)")
|
---|
| 13 | add_compile_options(
|
---|
| 14 | -fno-exceptions
|
---|
| 15 | -fno-rtti
|
---|
| 16 | -pedantic
|
---|
| 17 | -Wall
|
---|
| 18 | -Wcast-align
|
---|
| 19 | -Wcast-qual
|
---|
| 20 | -Wconversion
|
---|
| 21 | -Wctor-dtor-privacy
|
---|
| 22 | -Wdisabled-optimization
|
---|
| 23 | -Werror
|
---|
| 24 | -Wextra
|
---|
| 25 | -Wformat=2
|
---|
| 26 | -Winit-self
|
---|
| 27 | -Wmissing-include-dirs
|
---|
| 28 | -Wno-parentheses
|
---|
| 29 | -Wno-sign-conversion
|
---|
| 30 | -Wno-unused
|
---|
| 31 | -Wno-variadic-macros
|
---|
| 32 | -Wnon-virtual-dtor
|
---|
| 33 | -Wold-style-cast
|
---|
| 34 | -Woverloaded-virtual
|
---|
| 35 | -Wredundant-decls
|
---|
| 36 | -Wshadow
|
---|
| 37 | -Wsign-promo
|
---|
| 38 | -Wstrict-overflow=5
|
---|
| 39 | -Wundef
|
---|
| 40 | )
|
---|
| 41 | endif()
|
---|
| 42 |
|
---|
| 43 | if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
---|
| 44 | add_compile_options(
|
---|
| 45 | -Wstrict-null-sentinel
|
---|
| 46 | )
|
---|
| 47 |
|
---|
| 48 | if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.5)
|
---|
| 49 | add_compile_options(-Wlogical-op) # the flag exists in 4.4 but is buggy
|
---|
| 50 | endif()
|
---|
| 51 |
|
---|
| 52 | if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.6)
|
---|
| 53 | add_compile_options(-Wnoexcept)
|
---|
| 54 | endif()
|
---|
| 55 | endif()
|
---|
| 56 |
|
---|
| 57 | if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
---|
| 58 | add_compile_options(
|
---|
| 59 | -Wc++11-compat
|
---|
| 60 | -Wdeprecated-register
|
---|
| 61 | )
|
---|
| 62 | endif()
|
---|
| 63 |
|
---|
| 64 | if(MSVC)
|
---|
| 65 | add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
---|
| 66 | add_compile_options(-W4)
|
---|
| 67 | endif()
|
---|
| 68 |
|
---|
| 69 | add_library(ArduinoJson ${CPP_FILES} ${HPP_FILES} ${IPP_FILES})
|
---|
| 70 |
|
---|
| 71 | target_include_directories(ArduinoJson INTERFACE ${CMAKE_CURRENT_LIST_DIR}/../include)
|
---|
Note:
See
TracBrowser
for help on using the repository browser.