Skip to content

Commit 0850ed4

Browse files
committed
cmake : define WHISPER_BIG_ENDIAN for big-endian targets
1 parent 77e6caa commit 0850ed4

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ set_target_properties(whisper PROPERTIES
9494
target_include_directories(whisper PUBLIC . ../include)
9595
target_compile_features (whisper PUBLIC cxx_std_11) # don't bump
9696

97+
if (CMAKE_CXX_BYTE_ORDER STREQUAL "BIG_ENDIAN")
98+
set(WHISPER_EXTRA_FLAGS ${WHISPER_EXTRA_FLAGS} -DWHISPER_BIG_ENDIAN)
99+
endif()
100+
97101
if (WHISPER_EXTRA_FLAGS)
98102
target_compile_options(whisper PRIVATE ${WHISPER_EXTRA_FLAGS})
99103
endif()

src/whisper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
#pragma warning(disable: 4244 4267) // possible loss of data
4040
#endif
4141

42-
#if defined(GGML_BIG_ENDIAN)
42+
#if defined(WHISPER_BIG_ENDIAN)
4343
template<typename T>
4444
static T byteswap(T value) {
4545
T value_swapped;

0 commit comments

Comments
 (0)