1
0

CheckCompilerFlagSwift.cmake 522 B

123456789101112131415161718192021
  1. enable_language (Swift)
  2. include(CheckCompilerFlag)
  3. set(Swift 1)
  4. # test that the check uses an isolated locale
  5. set(_env_LC_ALL "${LC_ALL}")
  6. set(ENV{LC_ALL} "BAD")
  7. check_compiler_flag(Swift "-foo-as-blarpy" SHOULD_FAIL)
  8. if(SHOULD_FAIL)
  9. message(SEND_ERROR "invalid Swift compile flag didn't fail.")
  10. endif()
  11. check_compiler_flag(Swift "-parseable-output" SHOULD_WORK)
  12. if(NOT SHOULD_WORK)
  13. message(SEND_ERROR "Swift compiler flag '-parseable-output' check failed")
  14. endif()
  15. # Reset locale
  16. set(ENV{LC_ALL} ${_env_LC_ALL})