Skip to content

Commit

Permalink
Fix ASTC link error on Mac arm64 hardware (#970)
Browse files Browse the repository at this point in the history
  • Loading branch information
jherico committed Mar 10, 2024
1 parent ef5959b commit eaba512
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions third_party/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,13 @@ set(ASTC_TARGET ${ASTC_RAW_TARGET} PARENT_SCOPE)
# astc
add_subdirectory(astc)

# ASTC apparently tries to build for x86_64 even on Mac arm64 architectures,
# but we can force it to build for the correct arch
# Upstream bug: https://github.com/ARM-software/astc-encoder/issues/458
if (APPLE AND (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "arm64"))
set_target_properties(${ASTC_RAW_TARGET} PROPERTIES OSX_ARCHITECTURES "arm64")
endif()

# astc doesn't have separate directories for it's source code and public interface. Additionally, it includes it's
# own copy of STB. In order to avoid conflicts, we copy the only header we need to the build directory and alter the
# INTERFACE_INCLUDE_DIRECTORIES of the target
Expand Down

0 comments on commit eaba512

Please sign in to comment.