Skip to content

Commit

Permalink
CMake: Check compiler type for MSVC speicific option
Browse files Browse the repository at this point in the history
The '/w' option is specific to MSVC in Windows. So, check the compiler
type before adding that compiler flag. This fixes the following error
in mingw toolchain.

cc: error: no such file or directory: '/w'
  • Loading branch information
Biswa96 committed Apr 22, 2023
1 parent 4def2dd commit ca792f3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions CMakeLists.txt
Expand Up @@ -293,8 +293,10 @@ if(WIN32)
set(REGEX_MALLOC 1)
set(USE_GENERIC_MS_NINT 1)
set(HAVE_STRING_H 0)
# Suppress warnings for regex.c
set_source_files_properties(${REGEX_SOURCES} PROPERTIES COMPILE_FLAGS /w)
if(MSVC)
# Suppress warnings for regex.c
set_source_files_properties(${REGEX_SOURCES} PROPERTIES COMPILE_FLAGS /w)
endif(MSVC)
else(WIN32)
set(REGEX_SOURCES "")
endif(WIN32)
Expand Down

0 comments on commit ca792f3

Please sign in to comment.