Skip to content

Commit 7f91135

Browse files
fix(r/sedonadb): Add -Wno-pedantic to avoid compile error (#181)
1 parent b320337 commit 7f91135

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

r/sedonadb/src/Makevars.in

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ PKG_LIBS = -L$(LIBDIR) -lsedonadbr @PKG_LIBS@
3030

3131
CARGO_BUILD_ARGS = --lib --profile $(PROFILE) $(FEATURE_FLAGS) --manifest-path=./rust/Cargo.toml --target-dir $(TARGET_DIR)
3232

33+
# "-Wno-pedantic" is to override the "-pedantic" flag passed by pkgbuild, which
34+
# makes the compilation of aws-lc-sys fail. Hopefully, such C code will be fixed
35+
# on upstream so that we can remove this.
36+
CFLAGS_TWEAKED = $(CFLAGS) -Wno-pedantic
37+
3338
all: $(SHLIB) clean_intermediate
3439

3540
$(SHLIB): $(STATLIB)
@@ -40,7 +45,7 @@ $(STATLIB):
4045
# therefore is only used if cargo is absent from the user's PATH.
4146
export PATH="$(PATH):$(HOME)/.cargo/bin" && \
4247
export CC="$(CC)" && \
43-
export CFLAGS="$(CFLAGS)" && \
48+
export CFLAGS="$(CFLAGS_TWEAKED)" && \
4449
export AWS_LC_SYS_CMAKE_BUILDER=1 && \
4550
export RUSTFLAGS="$(RUSTFLAGS)" && \
4651
if [ "$(TARGET)" != "wasm32-unknown-emscripten" ]; then \

r/sedonadb/src/Makevars.win.in

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,10 @@ CARGO_LINKER = x86_64-w64-mingw32.static.posix-gcc.exe
3737
# cf. https://stackoverflow.com/a/68979087
3838
PKG_CONFIG_SYSROOT_DIR = /x86_64-w64-mingw32.static.posix/
3939

40-
# TODO: should $(CFLAGS) be included here?
41-
# Do not pass -pedantic
42-
CFLAGS_TWEAKED = $(subst -pedantic,,$(ALL_CPPFLAGS))
40+
# "-Wno-pedantic" is to override the "-pedantic" flag passed by pkgbuild, which
41+
# makes the compilation of aws-lc-sys fail. Hopefully, such C code will be fixed
42+
# on upstream so that we can remove this.
43+
CFLAGS_TWEAKED = $(CFLAGS) -Wno-pedantic
4344

4445
all: $(SHLIB) clean_intermediate
4546

@@ -51,11 +52,6 @@ $(STATLIB):
5152
# in actual, but we need this tweak to please the compiler.
5253
mkdir -p $(LIBDIR)/libgcc_mock && touch $(LIBDIR)/libgcc_mock/libgcc_eh.a
5354

54-
# AWS_LC_SYS_CFLAGS are not ideal: It would be better to use the
55-
# CMake builder but this incurs path length errors on at least one Windows builder.
56-
# The AWS_LC_SYS_CMAKE_BUILDER environment variable can still be set at a
57-
# higher level on Windows environments that support it.
58-
5955
export CARGO_TARGET_X86_64_PC_WINDOWS_GNU_LINKER="$(CARGO_LINKER)" && \
6056
export LIBRARY_PATH="$${LIBRARY_PATH};$(LIBDIR)/libgcc_mock" && \
6157
export PKG_CONFIG_SYSROOT_DIR="$(PKG_CONFIG_SYSROOT_DIR)" && \

0 commit comments

Comments
 (0)