Alexey Samsonov | 9a1ffce | 2014-02-18 07:26:58 +0000 | [diff] [blame^] | 1 | include(CheckCXXCompilerFlag) |
| 2 | |
| 3 | # CodeGen options. |
| 4 | check_cxx_compiler_flag(-fPIC COMPILER_RT_HAS_FPIC_FLAG) |
| 5 | check_cxx_compiler_flag(-fno-builtin COMPILER_RT_HAS_FNO_BUILTIN_FLAG) |
| 6 | check_cxx_compiler_flag(-fno-exceptions COMPILER_RT_HAS_FNO_EXCEPTIONS_FLAG) |
| 7 | check_cxx_compiler_flag(-fomit-frame-pointer COMPILER_RT_HAS_FOMIT_FRAME_POINTER_FLAG) |
| 8 | check_cxx_compiler_flag(-funwind-tables COMPILER_RT_HAS_FUNWIND_TABLES_FLAG) |
| 9 | check_cxx_compiler_flag(-fno-stack-protector COMPILER_RT_HAS_FNO_STACK_PROTECTOR_FLAG) |
| 10 | check_cxx_compiler_flag(-fvisibility=hidden COMPILER_RT_HAS_FVISIBILITY_HIDDEN_FLAG) |
| 11 | check_cxx_compiler_flag("-Werror -fno-function-sections" COMPILER_RT_HAS_FNO_FUNCTION_SECTIONS_FLAG) |
| 12 | |
| 13 | check_cxx_compiler_flag(/GS COMPILER_RT_HAS_GS_FLAG) |
| 14 | check_cxx_compiler_flag(/MT COMPILER_RT_HAS_MT_FLAG) |
| 15 | check_cxx_compiler_flag(/Oy COMPILER_RT_HAS_Oy_FLAG) |
| 16 | |
| 17 | # Debug info flags. |
| 18 | check_cxx_compiler_flag(-gline-tables-only COMPILER_RT_HAS_GLINE_TABLES_ONLY_FLAG) |
| 19 | check_cxx_compiler_flag(-g COMPILER_RT_HAS_G_FLAG) |
| 20 | check_cxx_compiler_flag(/Zi COMPILER_RT_HAS_Zi_FLAG) |
| 21 | |
| 22 | # Warnings. |
| 23 | check_cxx_compiler_flag("-Werror -Wframe-larger-than=512" COMPILER_RT_HAS_WFRAME_LARGER_THAN_FLAG) |
| 24 | check_cxx_compiler_flag("-Werror -Wglobal-constructors" COMPILER_RT_HAS_WGLOBAL_CONSTRUCTORS_FLAG) |
| 25 | check_cxx_compiler_flag("-Werror -Wno-c99-extensions" COMPILER_RT_HAS_WNO_C99_EXTENSIONS_FLAG) |
| 26 | check_cxx_compiler_flag("-Werror -Wno-gnu" COMPILER_RT_HAS_WNO_GNU_FLAG) |
| 27 | check_cxx_compiler_flag("-Werror -Wno-non-virtual-dtor" COMPILER_RT_HAS_WNO_NON_VIRTUAL_DTOR_FLAG) |
| 28 | check_cxx_compiler_flag("-Werror -Wno-variadic-macros" COMPILER_RT_HAS_WNO_VARIADIC_MACROS_FLAG) |
| 29 | |
| 30 | check_cxx_compiler_flag(/wd4722 COMPILER_RT_HAS_WD4722_FLAG) |