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

iOS build on cmake 3.19 (Apple silicon) #138

Closed
eleanor-em opened this issue Jan 27, 2021 · 2 comments
Closed

iOS build on cmake 3.19 (Apple silicon) #138

eleanor-em opened this issue Jan 27, 2021 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@eleanor-em
Copy link
Collaborator

eleanor-em commented Jan 27, 2021

Bug Report

Current Behavior
From the project root, make build-ios fails with the following message:

error: unable to attach DB: error: accessing build database "...": database is locked Possibly there are two concurrent builds running in the same filesystem location.

Expected behavior/code
The build should succeed.

Environment

  • OS: macOS 11.1 (Big Sur)
  • Architecture: arm64 (Apple silicon)
  • CMake version: 3.19

Possible Solution
This issue has been discussed at the cmake project repository. There is an easy fix: add the argument -T buildsystem=1 at the end of line 133 of the makefile.

@AddressXception
Copy link
Collaborator

I installed cmake 3.19.1 and Xcode 12.4 (12D4e) on my x64 mac and was able to reproduce this issue, but I then explicitly removed the -GXcode call and it appears to be working again. I don't have an M1 mac so I'm not sure this is a good test. Can you try with the below configuration and lmk if that works?

like so:

ifeq ($(OPERATING_SYSTEM),Darwin)
	cmake -S . -B $(ELECTIONGUARD_BUILD_LIBS_DIR)/ios/$(TARGET) \
		-DCMAKE_BUILD_TYPE=$(TARGET) \
		-DCPM_SOURCE_CACHE=$(CPM_SOURCE_CACHE) \
		-DCMAKE_SYSTEM_NAME=iOS \
		"-DCMAKE_OSX_ARCHITECTURES=arm64;arm64e;x86_64" \
		-DCMAKE_OSX_DEPLOYMENT_TARGET=12.4 \
		-DCMAKE_INSTALL_PREFIX=$(ELECTIONGUARD_BUILD_LIBS_DIR)/ios/$(TARGET) \
		-DCMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH=NO \
		-DCMAKE_IOS_INSTALL_COMBINED=YES
	cmake --build $(ELECTIONGUARD_BUILD_LIBS_DIR)/ios/$(TARGET) --config $(TARGET) --target install

@eleanor-em
Copy link
Collaborator Author

Hey @AddressXception, yep I pulled the changes and it works great now. Thanks for this! Feel free to close if you're happy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants