CMakeLists.txt 924 B

123456789101112131415161718192021222324252627282930313233343536
  1. # ArduinoJson - https://arduinojson.org
  2. # Copyright © 2014-2022, Benoit BLANCHON
  3. # MIT License
  4. if("cxx_nullptr" IN_LIST CMAKE_CXX_COMPILE_FEATURES)
  5. list(APPEND SOURCES nullptr.cpp)
  6. add_definitions(-DARDUINOJSON_HAS_NULLPTR=1)
  7. endif()
  8. if("cxx_auto_type" IN_LIST CMAKE_CXX_COMPILE_FEATURES AND "cxx_constexpr" IN_LIST CMAKE_CXX_COMPILE_FEATURES)
  9. list(APPEND SOURCES issue1120.cpp)
  10. endif()
  11. if("cxx_long_long_type" IN_LIST CMAKE_CXX_COMPILE_FEATURES)
  12. list(APPEND SOURCES use_long_long_0.cpp use_long_long_1.cpp)
  13. endif()
  14. if("cxx_range_for" IN_LIST CMAKE_CXX_COMPILE_FEATURES AND "cxx_generalized_initializers" IN_LIST CMAKE_CXX_COMPILE_FEATURES)
  15. list(APPEND SOURCES stl_containers.cpp)
  16. endif()
  17. if(NOT SOURCES)
  18. return()
  19. endif()
  20. set(CMAKE_CXX_STANDARD 11)
  21. set(CMAKE_CXX_STANDARD_REQUIRED ON)
  22. add_executable(Cpp11Tests ${SOURCES})
  23. add_test(Cpp11 Cpp11Tests)
  24. set_tests_properties(Cpp11
  25. PROPERTIES
  26. LABELS "Catch"
  27. )