File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -176,14 +176,33 @@ function(get_program_version_major_minor name ret)
176
176
PARENT_SCOPE )
177
177
endfunction ()
178
178
179
+ # Checks compiler for given ${flag}, stores the output in C_HAS_${flag} and
180
+ # CXX_HAS_${flag} (if compiler supports C++)
181
+ function (check_compilers_flag flag )
182
+ check_c_compiler_flag ("${flag} " "C_HAS_${flag} " )
183
+ if (CMAKE_CXX_COMPILE_FEATURES )
184
+ check_cxx_compiler_flag ("${flag} " "CXX_HAS_${flag} " )
185
+ endif ()
186
+ endfunction ()
187
+
188
+ function (check_add_target_compile_options target )
189
+ foreach (option ${ARGN} )
190
+ check_compilers_flag (${option} )
191
+ if (C_HAS_${option} AND CXX_HAS_${option} )
192
+ target_compile_options (${target} PRIVATE ${option} )
193
+ endif ()
194
+ endforeach ()
195
+ endfunction ()
196
+
179
197
function (add_umf_target_compile_options name )
198
+ check_add_target_compile_options (${name} "-Wno-covered-switch-default" )
199
+
180
200
if (NOT MSVC )
181
201
target_compile_options (
182
202
${name}
183
203
PRIVATE -fPIC
184
204
-Wall
185
205
-Wextra
186
- -Werror
187
206
-Wpedantic
188
207
-Wempty-body
189
208
-Wunused-parameter
You can’t perform that action at this time.
0 commit comments