From 3f316e42f2bac35c57673a0e824c272615279958 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Sat, 14 Dec 2024 21:35:42 +0100 Subject: [PATCH] build: Remove unavailable warning flags from gcc builds --- cmake/build_helpers.cmake | 3 ++- lib/third_party/imgui/imgui/CMakeLists.txt | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/cmake/build_helpers.cmake b/cmake/build_helpers.cmake index 7bbc9651b..7fae1e723 100644 --- a/cmake/build_helpers.cmake +++ b/cmake/build_helpers.cmake @@ -575,7 +575,7 @@ macro(setupCompilerFlags target) set(IMHEX_CXX_FLAGS "-fexceptions -frtti") # Disable some warnings - set(IMHEX_C_CXX_FLAGS "-Wno-unknown-warning-option -Wno-array-bounds -Wno-deprecated-declarations -Wno-unknown-pragmas") + set(IMHEX_C_CXX_FLAGS "-Wno-array-bounds -Wno-deprecated-declarations -Wno-unknown-pragmas") endif() if (CMAKE_CXX_COMPILER_ID MATCHES "GNU") @@ -588,6 +588,7 @@ macro(setupCompilerFlags target) execute_process(COMMAND brew --prefix llvm OUTPUT_VARIABLE LLVM_PREFIX OUTPUT_STRIP_TRAILING_WHITESPACE) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L${LLVM_PREFIX}/lib/c++") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L${LLVM_PREFIX}/lib/c++") + set(IMHEX_C_CXX_FLAGS "-Wno-unknown-warning-option") endif() # Disable some warnings for gcc diff --git a/lib/third_party/imgui/imgui/CMakeLists.txt b/lib/third_party/imgui/imgui/CMakeLists.txt index 159188092..61f37ee6b 100644 --- a/lib/third_party/imgui/imgui/CMakeLists.txt +++ b/lib/third_party/imgui/imgui/CMakeLists.txt @@ -20,7 +20,9 @@ if (NOT IMHEX_EXTERNAL_PLUGIN_BUILD) include/misc/freetype ) - target_compile_options(imgui_imgui PRIVATE -Wno-unknown-warning-option) + if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + target_compile_options(imgui_imgui PRIVATE -Wno-unknown-warning-option) + endif() find_package(Freetype REQUIRED)