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

add support for cross compiling on apple platforms #350

Merged
merged 2 commits into from
Jan 24, 2025

Conversation

ram-mohan
Copy link
Contributor

partially fixes #345

Build: cmake -G Ninja -DCMAKE_OSX_ARCHITECTURES=arm64 ../ && ninja

Copy link

google-cla bot commented Jan 21, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

partially fixes google#345

Build: cmake -G Ninja -DCMAKE_OSX_ARCHITECTURES=arm64 ../ && ninja
@ram-mohan
Copy link
Contributor Author

@DichenZhang1 this can be merged dichen

@DichenZhang1 DichenZhang1 merged commit bf2aa43 into google:main Jan 24, 2025
1 check failed
@harishdm harishdm deleted the crosscompile branch January 28, 2025 04:52
@gregbenz
Copy link

@ram-mohan @DichenZhang1
Should this change allow compiling for MacIntel on Apple Silicon?

The following build command fails:

cmake -DBUILD_SHARED_LIBS=0 -DUHDR_WRITE_XMP=1 -DUHDR_WRITE_ISO=1 -G Ninja -DCMAKE_OSX_ARCHITECTURES=x86_64 ../

ninja

It throws a number of errors due to libjpeg not having x86 code:

[51/51] Linking CXX executable ultrahdr_app
FAILED: ultrahdr_app
: && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -O3 -DNDEBUG -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names  CMakeFiles/ultrahdr_app.dir/examples/ultrahdr_app.cpp.o -o ultrahdr_app  libcore.a  /opt/homebrew/lib/libjpeg.a  libimage_io.a && :
ld: warning: ignoring file '/opt/homebrew/lib/libjpeg.a[117](jutils.c.o)': found architecture 'arm64', required architecture 'x86_64'

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

Successfully merging this pull request may close these issues.

cross-compiling/building universal binaries on macOS broken?
4 participants