silences warnings like
[2/768] /usr/bin/x86_64-w64-mingw32-gcc-posix -DBOOST_ASIO_DISABLE_THREAD_KEYWORD_EXTENSION -DHAVE_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -D_POSIX=1 -D_POSIX_=1 -D_POSIX_C_SOURCE=1
-D_POSIX_THREADS=1 -D_REENTRANT -D_THREAD_SAFE -D_WIN32_WINNT=0x0A00 -D__CEPH__ -D__STDC_FORMAT_MACROS -Isrc/include -I../src -I../src/include/win32 -isystem ../build.deps/mingw/boost/include -isystem
include -isystem ../src/xxHash -isystem ../src/rapidjson/include -isystem ../src/fmt/include -O3 -DNDEBUG -include winsock_wrapper.h -include win32_errno.h -U_FORTIFY_SOURCE -Wall
-fno-strict-aliasing -fsigned-char -Wtype-limits -Wignored-qualifiers -Wpointer-arith -Werror=format-security -Winit-self -Wno-unknown-pragmas -fpermissive -fdiagnostics-color=auto -std=gnu99 -MD -MT
src/CMakeFiles/common-objs.dir/xxHash/xxhash.c.obj -MF src/CMakeFiles/common-objs.dir/xxHash/xxhash.c.obj.d -o src/CMakeFiles/common-objs.dir/xxHash/xxhash.c.obj -c ../src/xxHash/xxhash.c
cc1: warning: command line option '-fpermissive' is valid for C++/ObjC++ but not for C
see also
https://gcc.gnu.org/onlinedocs/gcc-4.0.4/gcc/C_002b_002b-Dialect-Options.html
Signed-off-by: Kefu Chai <kchai@redhat.com>
if(CMAKE_CXX_COMPILER_ID STREQUAL GNU)
if(MINGW)
# The MINGW headers are missing some "const" qualifiers.
- add_compile_options($<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:-fpermissive>)
+ add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-fpermissive>)
else()
string(APPEND CMAKE_EXE_LINKER_FLAGS " -rdynamic")
endif()