Skip to content

Commit

Permalink
Basis{ImageConverter,Importer}: fix compilation on GCC < 5
Browse files Browse the repository at this point in the history
  • Loading branch information
pezcode committed Sep 14, 2024
1 parent 5446a00 commit f93afc5
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions modules/FindBasisUniversal.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,15 @@ foreach(_component ${BasisUniversal_FIND_COMPONENTS})

set(BasisUniversalEncoder_DEFINITIONS "BASISU_NO_ITERATOR_DEBUG_LEVEL")

# Basis already checks for GCC < 5 to work around missing
# std::is_trivially_copyable but then uses the wrong built-in.
# So close, yet so far.
# Needs to be transitive because it's used in a header file.
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "5.0")
list(APPEND BasisUniversalEncoder_DEFINITIONS
"__is_trivially_copyable=__has_trivial_copy")
endif()

# Try to find an external OpenCL library and enable support for
# it in basis if found.
find_package(OpenCL QUIET)
Expand Down Expand Up @@ -313,6 +322,11 @@ foreach(_component ${BasisUniversal_FIND_COMPONENTS})

set(BasisUniversalTranscoder_DEFINITIONS "BASISU_NO_ITERATOR_DEBUG_LEVEL")

if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "5.0")
list(APPEND BasisUniversalTranscoder_DEFINITIONS
"__is_trivially_copyable=__has_trivial_copy")
endif()

# Try to find an external Zstandard library because that's the
# sanest and most flexible option.
#
Expand Down

0 comments on commit f93afc5

Please sign in to comment.