File: AppendOptionIfAvailable.cmake

package info (click to toggle)
cub 1.11.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 3,716 kB
  • sloc: cpp: 1,466; ansic: 1,135; makefile: 375; sh: 22
file content (13 lines) | stat: -rw-r--r-- 266 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
include_guard(GLOBAL)
include(CheckCXXCompilerFlag)

macro (APPEND_OPTION_IF_AVAILABLE _FLAG _LIST)

string(MAKE_C_IDENTIFIER "CXX_FLAG_${_FLAG}" _VAR)
check_cxx_compiler_flag(${_FLAG} ${_VAR})

if (${${_VAR}})
  list(APPEND ${_LIST} ${_FLAG})
endif ()

endmacro ()