CMake: Make language explicit for per-file strict flags removal

This commit is contained in:
Sergey Sharybin 2018-06-22 14:40:00 +02:00
parent ec27776d8e
commit 6cd0484de8
Notes: blender-bot 2023-02-14 05:41:55 +01:00
Referenced by issue #55611, Blender crashes on save.
5 changed files with 22 additions and 11 deletions

View File

@ -1120,28 +1120,39 @@ endmacro()
# note, we can only append flags on a single file so we need to negate the options.
# at the moment we cant shut up ffmpeg deprecations, so use this, but will
# probably add more removals here.
macro(remove_strict_flags_file
macro(remove_strict_c_flags_file
filenames)
foreach(_SOURCE ${ARGV})
if(CMAKE_COMPILER_IS_GNUCC OR
(CMAKE_C_COMPILER_ID MATCHES "Clang"))
set_source_files_properties(${_SOURCE}
PROPERTIES
COMPILE_FLAGS "${C_REMOVE_STRICT_FLAGS}"
)
endif()
if(MSVC)
# TODO
endif()
endforeach()
unset(_SOURCE)
endmacro()
macro(remove_strict_cxx_flags_file
filenames)
remove_strict_c_flags_file(${filenames} ${ARHV})
foreach(_SOURCE ${ARGV})
if(CMAKE_COMPILER_IS_GNUCC OR
(CMAKE_C_COMPILER_ID MATCHES "Clang"))
set_source_files_properties(${_SOURCE}
PROPERTIES
COMPILE_FLAGS "${C_REMOVE_STRICT_FLAGS}"
)
endif()
if(MSVC)
# TODO
endif()
endforeach()
unset(_SOURCE)
endmacro()
# External libs may need 'signed char' to be default.

View File

@ -243,7 +243,7 @@ if(WITH_CODEC_FFMPEG)
ffmpeg/AUD_FFMPEGWriter.h
)
remove_strict_flags_file(
remove_strict_cxx_flags_file(
ffmpeg/AUD_FFMPEGFactory.cpp
ffmpeg/AUD_FFMPEGReader.cpp
ffmpeg/AUD_FFMPEGWriter.cpp

View File

@ -409,7 +409,7 @@ if(WITH_CODEC_FFMPEG)
)
add_definitions(-DWITH_FFMPEG)
remove_strict_flags_file(
remove_strict_c_flags_file(
intern/writeffmpeg.c
)
endif()

View File

@ -139,7 +139,7 @@ if(WITH_CODEC_FFMPEG)
)
add_definitions(-DWITH_FFMPEG)
remove_strict_flags_file(
remove_strict_c_flags_file(
intern/indexer.c
intern/util.c
intern/anim_movie.c

View File

@ -105,7 +105,7 @@ if(WITH_CODEC_FFMPEG)
)
add_definitions(-DWITH_FFMPEG)
remove_strict_flags_file(
remove_strict_cxx_flags_file(
VideoFFmpeg.cpp
VideoDeckLink
DeckLink