Skip to content

Commit eb989a2

Browse files
committed
Add big-endian build option
1 parent aee1e35 commit eb989a2

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ option(ASTCENC_ISA_NONE "Enable astcenc builds for no SIMD")
4545
option(ASTCENC_ISA_NATIVE "Enable astcenc builds for native SIMD")
4646
option(ASTCENC_DECOMPRESSOR "Enable astcenc builds for decompression only")
4747
option(ASTCENC_SHAREDLIB "Enable astcenc builds with core library shared objects")
48+
option(ASTCENC_BIG_ENDIAN "Enable astcenc big-endian support")
4849
option(ASTCENC_DIAGNOSTICS "Enable astcenc builds with diagnostic trace")
4950
option(ASTCENC_ASAN "Enable astcenc builds with address sanitizer")
5051
option(ASTCENC_UBSAN "Enable astcenc builds with undefined behavior sanitizer")
@@ -137,6 +138,9 @@ if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
137138
printopt("Universal bin " ${ASTCENC_UNIVERSAL_BUILD})
138139
endif()
139140
printopt("Invariance " ${ASTCENC_INVARIANCE})
141+
if(${ASTCENC_BIG_ENDIAN})
142+
printopt("Big endian " ${ASTCENC_BIG_ENDIAN})
143+
endif()
140144
printopt("Shared libs " ${ASTCENC_SHAREDLIB})
141145
printopt("Decompressor " ${ASTCENC_DECOMPRESSOR})
142146
message(STATUS "Developer options")

Source/UnitTest/cmake_core.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,12 @@ if(${ASTCENC_ISA_SIMD} MATCHES "none")
8585
ASTCENC_POPCNT=0
8686
ASTCENC_F16C=0)
8787

88+
if(${ASTCENC_BIG_ENDIAN})
89+
target_compile_definitions(${ASTCENC_TEST}
90+
PRIVATE
91+
ASTCENC_BIG_ENDIAN=1)
92+
endif()
93+
8894
elseif(${ASTCENC_ISA_SIMD} MATCHES "neon")
8995
target_compile_definitions(${ASTCENC_TEST}
9096
PRIVATE

Source/cmake_core.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,12 @@ macro(astcenc_set_properties ASTCENC_TARGET_NAME ASTCENC_VENEER_TYPE)
284284
ASTCENC_POPCNT=0
285285
ASTCENC_F16C=0)
286286

287+
if(${ASTCENC_BIG_ENDIAN})
288+
target_compile_definitions(${ASTCENC_TARGET_NAME}
289+
PRIVATE
290+
ASTCENC_BIG_ENDIAN=1)
291+
endif()
292+
287293
elseif(${ASTCENC_ISA_SIMD} MATCHES "neon")
288294
target_compile_definitions(${ASTCENC_TARGET_NAME}
289295
PRIVATE

0 commit comments

Comments
 (0)