Debian Codegraph @

Tests/GhsMulti/GhsMultiCompilerOptions/CMakeLists.txt.in

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