diff --git a/vendor/libraries/jpeg/Library.cmake b/vendor/libraries/jpeg/Library.cmake index 3bd4a39b73..68e0faa4e7 100644 --- a/vendor/libraries/jpeg/Library.cmake +++ b/vendor/libraries/jpeg/Library.cmake @@ -2,8 +2,18 @@ if(NOT DUNE_SYS_HAS_JPEG) file(GLOB DUNE_JPEG_FILES vendor/libraries/jpeg/*.c) + check_cxx_compiler_flag(-Wimplicit-fallthrough=0 _has_wimplicit_fallthrough_0) + if(_has_wimplicit_fallthrough_0) + set(_jpeg_extra_cflags "${_jpeg_extra_cflags} -Wimplicit-fallthrough=0") + endif() + + check_cxx_compiler_flag(-Wno-shift-negative-value _has_wno_shift_negative_value) + if(_has_wno_shift_negative_value) + set(_jpeg_extra_cflags "${_jpeg_extra_cflags} -Wno-shift-negative-value") + endif() + set_source_files_properties(${DUNE_JPEG_FILES} - PROPERTIES COMPILE_FLAGS "${DUNE_C_FLAGS}") + PROPERTIES COMPILE_FLAGS "${DUNE_C_FLAGS} ${_jpeg_extra_cflags}") list(APPEND DUNE_VENDOR_FILES ${DUNE_JPEG_FILES})