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

Fixed iOS cross building for old generators #9437

Merged
merged 1 commit into from Aug 30, 2021

Conversation

lasote
Copy link
Contributor

@lasote lasote commented Aug 17, 2021

Changelog: Fix: Fixed old CMake build helper to cross-build to iOS when two profiles are specified.
Docs: omit

Close #9202

@memsharded This is limited only to the usage of two profiles, only when build is Macos and host is iOS. Do you think this could still be risky?

@lasote lasote requested a review from memsharded August 17, 2021 09:31
@lasote lasote added this to the 1.40 milestone Aug 17, 2021
@SpaceIm
Copy link
Contributor

SpaceIm commented Aug 20, 2021

I guess all consumers using conan_basic_setup() in their CMakeLists want:

                self.definitions["CMAKE_FIND_ROOT_PATH_MODE_INCLUDE"] = "BOTH"
                self.definitions["CMAKE_FIND_ROOT_PATH_MODE_LIBRARY"] = "BOTH"
                self.definitions["CMAKE_FIND_ROOT_PATH_MODE_PACKAGE"] = "BOTH"

If it is set to ONLY by default, it breaks all the logic of this generator.

I mean, not only iOS needs to ensure BOTH for these variables (usually it's BOTH by default, but not if CMAKE_SYSTEM_NAME is iOS and also tvOS and watchOS I think).

Copy link
Member

@memsharded memsharded left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see the new toolchain setting CMAKE_FIND_ROOT_PATH_MODE_INCLUDE, am I missing something? Why this feature in the legacy generators but not the new ones?

@SpaceIm
Copy link
Contributor

SpaceIm commented Aug 20, 2021

I don't see the new toolchain setting CMAKE_FIND_ROOT_PATH_MODE_INCLUDE, am I missing something? Why this feature in the legacy generators but not the new ones?

find_package() doesn't need CMAKE_FIND_ROOT_PATH_MODE_PACKAGE BOTH in CMakeDeps (see #9202 (comment), but it could be replaced by CMAKE_FIND_ROOT_PATH_MODE_PACKAGE BOTH instead).
find_library(), find_path() and find_file() would also need #9427, CMAKE_FIND_ROOT_PATH_MODE_* BOTH is not sufficient.

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.

[bug] find_package can't find config files if cross compilation/2 profiles
3 participants