Skip to content

Commit

Permalink
Merge pull request #210 from fknfilewalker/clang>16fix
Browse files Browse the repository at this point in the history
fix for clang 17 and above (unsafe-buffer-usage warning results in error)
  • Loading branch information
syoyo authored Jul 23, 2024
2 parents 708641b + 7899343 commit cc12740
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,13 @@ target_include_directories(${BUILD_TARGET} PRIVATE ${PROJECT_SOURCE_DIR})
target_link_libraries(${BUILD_TARGET} ${TINYEXR_EXT_LIBRARIES} ${CMAKE_DL_LIBS})

# Increase warning level for clang.
IF (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND NOT MSVC)
set_source_files_properties(${TINYEXR_SOURCES} PROPERTIES COMPILE_FLAGS "-Weverything -Werror -Wno-padded -Wno-c++98-compat-pedantic -Wno-documentation -Wno-unused-member-function")
ENDIF ()
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND NOT MSVC)
set(CLANG_COMPILE_FLAGS "-Weverything -Werror -Wno-padded -Wno-c++98-compat-pedantic -Wno-documentation -Wno-unused-member-function")
if (${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER 16)
set(CLANG_COMPILE_FLAGS "${CLANG_COMPILE_FLAGS} -Wno-unsafe-buffer-usage")
endif()
set_source_files_properties(${TINYEXR_SOURCES} PROPERTIES COMPILE_FLAGS ${CLANG_COMPILE_FLAGS})
endif ()

if (TINYEXR_BUILD_SAMPLE)

Expand Down

0 comments on commit cc12740

Please sign in to comment.