CMakeLists.txt.in 925 B

1234567891011121314151617181920212223242526272829303132
  1. # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. # file Copyright.txt or https://cmake.org/licensing for details.
  3. cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
  4. project(test C)
  5. if(CMAKE_C_COMPILER_ID STREQUAL "GHS")
  6. add_link_options("-non_shared")
  7. endif()
  8. if(RUN_TEST STREQUAL "RELEASE_FLAGS")
  9. #RELEASE flags used when CMAKE_BUILD_TYPE is undefined
  10. string(APPEND CMAKE_C_FLAGS_RELEASE " -unexpected_release_option")
  11. add_executable(test_none test.c)
  12. endif()
  13. if(RUN_TEST STREQUAL "KERNEL_FLAGS")
  14. #DEBUG flag missing when -kernel is added as a compile option
  15. string(APPEND CMAKE_C_FLAGS_DEBUG " -required-debug-option")
  16. add_executable(K1 test.c)
  17. add_executable(K2 test.c)
  18. target_compile_options(K2 PRIVATE -kernel)
  19. add_executable(K3 test.c)
  20. target_compile_options(K3 PRIVATE -kernel=fast)
  21. add_executable(K4 test.c)
  22. target_link_options(K4 PRIVATE -kernel)
  23. endif()