File: FindC99.cmake

package info (click to toggle)
opm-common 2024.10%2Bds-5
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 98,420 kB
  • sloc: cpp: 263,013; python: 3,155; sh: 198; xml: 174; pascal: 136; makefile: 12
file content (25 lines) | stat: -rw-r--r-- 625 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# - Module that checks for supported C99 features.

# macro to only add option once
include (AddOptions)

# try to use compiler flag -std=c99
set (C_STD99_FLAGS "-std=c99")

# incidently, the C++ test is so simple that it can be used to compile C as well
include (CheckCCompilerFlag)
check_c_compiler_flag (${C_STD99_FLAGS} HAVE_C99)

# add option if we are capable
if (HAVE_C99)
  add_options (C ALL_BUILDS "${C_STD99_FLAGS}")
else (HAVE_C99)
  set (C_STD99_FLAGS)
endif (HAVE_C99)

# handle quiet and required
include (FindPackageHandleStandardArgs)
find_package_handle_standard_args (C99
  DEFAULT_MSG
  C_STD99_FLAGS
  )