fix build errors on Linux with Clang 20 and GTK warnings (#12507)

* guard -Wno-error=enum-constexpr-conversion behind compiler flag check

* Fix: Suppress GTK critical warnings and prevent multiple URI scheme registrations in WebView
This commit is contained in:
SoftFever
2026-03-01 18:43:15 +08:00
committed by GitHub
parent 04018980e1
commit b908bab904
4 changed files with 30 additions and 9 deletions

View File

@@ -436,7 +436,11 @@ if (NOT MSVC AND ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMP
endif()
if((${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "AppleClang") AND ${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER 15)
add_compile_options(-Wno-error=enum-constexpr-conversion)
include(CheckCXXCompilerFlag)
check_cxx_compiler_flag(-Wno-error=enum-constexpr-conversion HAS_WNO_ERROR_ENUM_CONSTEXPR_CONV)
if(HAS_WNO_ERROR_ENUM_CONSTEXPR_CONV)
add_compile_options(-Wno-error=enum-constexpr-conversion)
endif()
endif()
#GCC generates loads of -Wunknown-pragmas when compiling igl. The fix is not easy due to a bug in gcc, see