facebookresearch / ocean

Ocean is the in-house framework for Computer Vision (CV) and Augmented Reality (AR) applications at Meta. It is platform independent and is mainly implemented in C/C++.
https://facebookresearch.github.io/ocean/
MIT License
642 stars 58 forks source link

[cmake] Fix config of iOS test apps #21

Closed enpe closed 4 months ago

enpe commented 4 months ago

The list of source files of these apps included files that are only meant for the desktop versions of these test apps. They need to be excluded from iOS builds in order to avoid linker errors about duplicate symbols similar to this:

ld: warning: ignoring duplicate libraries: '/Users/nils/build_ocean_ios_release/impl/ocean/base/Debug-iphoneos/libocean_base.a', '/Users/nils/build_ocean_ios_release/impl/ocean/test/testcv/Debug-iphoneos/libocean_test_testcv.a'
duplicate symbol '_main' in:
    /Users/nils/build_ocean_ios_release/build/application_ocean_test_cv_testcv_testsegmentation_ios.build/Debug-iphoneos/Objects-normal/arm64/Main.o
    /Users/nils/build_ocean_ios_release/build/application_ocean_test_cv_testcv_testsegmentation_ios.build/Debug-iphoneos/Objects-normal/arm64/TestCVSegmentation.o
ld: 1 duplicate symbols
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Test plan:

On a Mac, follow the instructions for iOS builds:

https://github.com/facebookresearch/ocean/blob/main/building_for_ios.md

Then, build, install, and start each of the following targets from XCode:

facebook-github-bot commented 4 months ago

@enpe has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

facebook-github-bot commented 4 months ago

@enpe merged this pull request in facebookresearch/ocean@670edd918d153cda43920bc516a7241aae0b0352.