|
15 | 15 | # under the License. |
16 | 16 | # ---------------------------------------------------------------------------- |
17 | 17 |
|
| 18 | +include(../cmake_compiler.cmake) |
| 19 | + |
18 | 20 | set(ASTCENC_TEST test-unit-${ASTCENC_ISA_SIMD}) |
19 | 21 |
|
20 | 22 | add_executable(${ASTCENC_TEST}) |
@@ -57,27 +59,34 @@ target_compile_options(${ASTCENC_TEST} |
57 | 59 | $<$<PLATFORM_ID:Linux,Darwin>:-pthread> |
58 | 60 |
|
59 | 61 | # MSVC compiler defines |
60 | | - $<$<CXX_COMPILER_ID:MSVC>:/EHsc> |
| 62 | + $<${is_msvc_fe}:/EHsc> |
| 63 | + $<$<AND:$<BOOL:${ASTCENC_WERROR}>,${is_msvc_fe}>:/WX> |
| 64 | + $<${is_msvccl}:/wd4324> |
61 | 65 |
|
62 | 66 | # G++ and Clang++ compiler defines |
63 | | - $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wall> |
64 | | - $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wextra> |
65 | | - $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wpedantic> |
66 | | - $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Werror> |
67 | | - $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wshadow> |
68 | | - $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-c++98-compat-pedantic> |
69 | | - $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-c++98-c++11-compat-pedantic> |
70 | | - $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-float-equal> |
71 | | - $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-overriding-option> |
72 | | - $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-unsafe-buffer-usage> |
73 | | - $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-switch-default> |
| 67 | + $<${is_gnu_fe}:-Wall> |
| 68 | + $<${is_gnu_fe}:-Wextra> |
| 69 | + $<${is_gnu_fe}:-Wpedantic> |
| 70 | + $<$<AND:$<BOOL:${ASTCENC_WERROR}>,${is_gnu_fe}>:-Werror> |
| 71 | + $<${is_gnu_fe}:-Wshadow> |
| 72 | + $<${is_gnu_fe}:-Wdouble-promotion> |
| 73 | + $<${is_clang}:-Wdocumentation> |
| 74 | + |
| 75 | + # Hide noise thrown up by Clang 10 and clang-cl |
| 76 | + $<${is_gnu_fe}:-Wno-unknown-warning-option> |
| 77 | + $<${is_gnu_fe}:-Wno-c++98-compat-pedantic> |
| 78 | + $<${is_gnu_fe}:-Wno-c++98-c++11-compat-pedantic> |
| 79 | + $<${is_gnu_fe}:-Wno-float-equal> |
| 80 | + $<${is_gnu_fe}:-Wno-overriding-option> |
| 81 | + $<${is_gnu_fe}:-Wno-unsafe-buffer-usage> |
| 82 | + $<${is_clang}:-Wno-switch-default> |
74 | 83 |
|
75 | 84 | # Ignore things that the googletest build triggers |
76 | | - $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-unknown-warning-option> |
77 | | - $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-double-promotion> |
78 | | - $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-undef> |
79 | | - $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-reserved-identifier> |
80 | | - $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-global-constructors>) |
| 85 | + $<${is_gnu_fe}:-Wno-unknown-warning-option> |
| 86 | + $<${is_gnu_fe}:-Wno-double-promotion> |
| 87 | + $<${is_gnu_fe}:-Wno-undef> |
| 88 | + $<${is_gnu_fe}:-Wno-reserved-identifier> |
| 89 | + $<${is_gnu_fe}:-Wno-global-constructors>) |
81 | 90 |
|
82 | 91 | # Set up configuration for SIMD ISA builds |
83 | 92 | if(${ASTCENC_ISA_SIMD} MATCHES "none") |
|
0 commit comments