diff --git a/CMakeLists.txt b/CMakeLists.txt index 9c34da3977..e746ece555 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -261,6 +261,8 @@ add_compile_options( ) add_clang_compile_options("-Wshorten-64-to-32") +add_clang_cpp_compile_options("-Wno-noexcept-type") +add_gcc_cpp_compile_options("-Wno-noexcept-type") add_subdirectory(base) add_subdirectory(coding) diff --git a/cmake/OmimHelpers.cmake b/cmake/OmimHelpers.cmake index 4fb6e4e4b4..0dbdb0c139 100644 --- a/cmake/OmimHelpers.cmake +++ b/cmake/OmimHelpers.cmake @@ -168,6 +168,18 @@ function(add_gcc_compile_options) endif() endfunction() +function(add_clang_cpp_compile_options) + if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + add_compile_options("$<$:${ARGV}>") + endif() +endfunction() + +function(add_gcc_cpp_compile_options) + if (CMAKE_CXX_COMPILER_ID MATCHES "GNU") + add_compile_options("$<$:${ARGV}>") + endif() +endfunction() + function(export_directory_flags filename) get_directory_property(include_directories INCLUDE_DIRECTORIES) get_directory_property(definitions COMPILE_DEFINITIONS)