Skip to content

Compilation error with target x86_64-apple-ios #40

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

Closed
CedricCouton opened this issue Jul 24, 2020 · 4 comments
Closed

Compilation error with target x86_64-apple-ios #40

CedricCouton opened this issue Jul 24, 2020 · 4 comments

Comments

@CedricCouton
Copy link

CedricCouton commented Jul 24, 2020

Hi,

I encountered some errors during compilation when I compile with the target x86_64-apple-ios (it's ok with aarch64-apple-ios)
An exemple of error :
cargo:warning=couchbase-lite-core/vendor/fleece/API/fleece/FLSlice.h:18:19: note: expanded from macro 'FLAPI' cargo:warning= #define FLAPI noexcept cargo:warning= ^ cargo:warning=couchbase-lite-core/vendor/fleece/API/fleece/FLSlice.h:107:41: error: expected function body after function declarator cargo:warning=FLSliceResult FLSliceResult_New(size_t) FLAPI; cargo:warning=

After some research I found that noexcept is compilable with c++11 flag, so my is solution :
In build.rs (lig 116) I force the flag with .flag("-std=c++11") instead of flag_if_supported("-std=c++11")
But I don't understand why my compilation it is ok now. If the flag_if_supported don't add the flag because it is not supported (this is what the code do), if I force it with .flag and the compilation is ok, this indicates that it is supported, isn't it ?

Thanks

@Dushistov
Copy link
Owner

Looks like bug in https://github.com/alexcrichton/cc-rs , I will try to reproduce.

@Dushistov
Copy link
Owner

I can not reproduce.
I tried with current master and all compiles just fine.

cd /Users/evgeniy/projects/rust-infra/couchbase-lite-rust/couchbase-lite
git submodule update --init --recursive
cargo build --target=x86_64-apple-ios

@agg23
Copy link
Contributor

agg23 commented Dec 27, 2021

Am experiencing this on the M1 simulator:

cargo build --target=aarch64-apple-ios-sim

Thanks @CedricCouton for the fix.

@Dushistov
Copy link
Owner

This is cmake-rs issue: rust-lang/cmake-rs#96 .

And now you can build couchbase-lite-core manually and use COUCHBASE_LITE_CORE_BUILD_DIR COUCHBASE_LITE_CORE_SRC_DIR and proper features to link with your copy of couchbase. Example can be found here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants