25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12 lines
393 B

  1. include(CheckCCompilerFlag)
  2. function(add_if_flag_compiles flag)
  3. CHECK_C_COMPILER_FLAG("${flag}" COMPILER_HAS_THOSE_TOGGLES)
  4. set(outcome "Failed")
  5. if(COMPILER_HAS_THOSE_TOGGLES)
  6. foreach(var ${ARGN})
  7. set(${var} "${flag} ${${var}}" PARENT_SCOPE)
  8. endforeach()
  9. set(outcome "compiles")
  10. endif()
  11. message(STATUS "Testing if ${flag} can be used -- ${outcome}")
  12. endfunction()