-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Fix apple frameworks in CMake generators #6003
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it looks much better now. Fix the test of mac, should be changing the assert only. The messages for the framework are now much more explanatory.
@memsharded please review.
@@ -96,6 +106,11 @@ def cmake_dependencies(dependencies, build_type=""): | |||
set(CONAN_SHARED_LINKER_FLAGS{build_type} "{deps.sharedlinkflags} ${{CONAN_SHARED_LINKER_FLAGS{build_type}}}") | |||
set(CONAN_EXE_LINKER_FLAGS{build_type} "{deps.exelinkflags} ${{CONAN_EXE_LINKER_FLAGS{build_type}}}") | |||
set(CONAN_C_FLAGS{build_type} "{deps.cflags} ${{CONAN_C_FLAGS{build_type}}}") | |||
|
|||
# Apple Frameworks | |||
conan_find_apple_frameworks(CONAN_FRAMEWORKS{build_type} CONAN_FRAMEWORKS_FOUND{build_type}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would do this call earlier before the first CONAN_LIBS declaration. It is not easy to see that it has been aggregated. Is it possible?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The thing here is that you need CONAN_FRAMEWORKS defined before this call and then assign the values found to CONAN_LIBS. So first frameworks, then function call, and finally conan_libs.
However, many tests check the library values of CONAN_LIBS and didn't want to modify all the tests for this PR.
If you advise me to do it, I will do it without any problem.
work around a failing test
# Append to aggregated values variable | ||
set(CONAN_LIBS_{dep}{build_type} ${{CONAN_PKG_LIBS_{dep}{build_type}}} ${{CONAN_SYSTEM_LIBS_{dep}{build_type}}} ${{CONAN_FRAMEWORKS_FOUND_{dep}{build_type}}}) | ||
# Aggregate package libs and frameworks for conan_package_library_targets() | ||
set(CONAN_LIBS_FRAMEWORKS_{dep}{build_type} ${{CONAN_PKG_LIBS_{dep}{build_type}}} ${{CONAN_FRAMEWORKS_FOUND_{dep}{build_type}}}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we have no model to differentiate packaged frameworks from system frameworks, we are considering frameworks part of the libs of the package in order to create the targets later
Changelog: Feature: Provide
CONAN_FRAMEWORKS
andCONAN_FRAMEWORKS_FOUND
for Apple frameworks in CMake generators andconan_find_apple_frameworks()
macro helper in CMake generators.Docs: conan-io/docs#1472
#TAGS: slow
develop
branch, documenting this one.Note: By default this PR will skip the slower tests and will use a limited set of python versions. Check here how to increase the testing level by writing some tags in the current PR body text.