Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix building with clang due to preprocessor issue in header #1

Merged
merged 1 commit into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions build-cmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,19 @@ fi
top="$(pwd)"
stage="$top/stage"

# load autobuild provided shell functions and variables
source_environment_tempfile="$stage/source_environment.sh"
"$autobuild" source_environment > "$source_environment_tempfile"
. "$source_environment_tempfile"

# apply_patch
source "$(dirname "$AUTOBUILD_VARIABLES_FILE")/functions"

# load autobuild provided shell functions and variables
SSE2NEON_SOURCE_DIR="sse2neon"

apply_patch "patches/fix-clang-build.patch" $SSE2NEON_SOURCE_DIR

mkdir -p "$stage/include/sse2neon"
cp -a $SSE2NEON_SOURCE_DIR/*.h "$stage/include/sse2neon"
mkdir -p "$stage/LICENSES"
Expand Down
13 changes: 13 additions & 0 deletions patches/fix-clang-build.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/sse2neon.h b/sse2neon.h
index 8c84053..e801907 100644
--- a/sse2neon.h
+++ b/sse2neon.h
@@ -104,7 +104,7 @@
#pragma message("Macro name collisions may happen with unsupported compilers.")
#endif

-#if defined(__GNUC__) && __GNUC__ < 10
+#if !defined(__clang__) && defined(__GNUC__) && __GNUC__ < 10
#warning "GCC versions earlier than 10 are not supported."
#endif

Loading