Skip to content

Commit

Permalink
Update CMakeLists.txt to fix gcc/clang++ issue (assimp#5863)
Browse files Browse the repository at this point in the history
This resolves an issue where using GCC as your C compiler but, say, clang++ as your CXX compiler produces
`error: unknown warning option '-Wno-dangling-reference' [-Werror,-Wunknown-warning-option]`

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
  • Loading branch information
jwbla and kimkulling authored Nov 6, 2024
1 parent 6520354 commit 9694f7e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -289,7 +289,7 @@ IF ((CMAKE_C_COMPILER_ID MATCHES "GNU") AND NOT MINGW AND NOT HAIKU)
SET(CMAKE_POSITION_INDEPENDENT_CODE ON)
ENDIF()

IF(CMAKE_CXX_COMPILER_VERSION GREATER_EQUAL 13)
IF(CMAKE_CXX_COMPILER_VERSION GREATER_EQUAL 13 AND CMAKE_CXX_COMPILER_ID MATCHES "GNU")
MESSAGE(STATUS "GCC13 detected disabling \"-Wdangling-reference\" in Cpp files as it appears to be a false positive")
ADD_COMPILE_OPTIONS("$<$<COMPILE_LANGUAGE:CXX>:-Wno-dangling-reference>")
ENDIF()

0 comments on commit 9694f7e

Please sign in to comment.