-
Notifications
You must be signed in to change notification settings - Fork 7.6k
[vcpkg] Meson osx sysroot #21772
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
[vcpkg] Meson osx sysroot #21772
Changes from 5 commits
19d1706
4c298e5
267e8e3
d1f915c
7e4ecfe
c56c9c1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -101,8 +101,8 @@ macro(_vcpkg_adjust_flags flag_var) | |
| foreach(arch IN LISTS CMAKE_OSX_ARCHITECTURES) | ||
| string(APPEND ${flag_var} " -arch ${arch}") | ||
| endforeach() | ||
| string(APPEND ${flag_var} " -isysroot ${CMAKE_OSX_SYSROOT}") | ||
| endif() | ||
| string(APPEND ${flag_var} " -isysroot ${CMAKE_OSX_SYSROOT}") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this looks like cmake should already be adding the flags (answer to https://github.com/microsoft/vcpkg/pull/21772/files#r760911069 ?)
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unfortunately not. It adds the falgs only to the compiler variable but not to the linker. I am afraid we cannot add it to the linker here, because it might break autotools.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
That is not good enough. It either breaks or it doesn't. And if it breaks the question is: 'why?' |
||
| endif() | ||
| endif() | ||
| endmacro() | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
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.
Add it to the linker flags in
get_cmake_vars/CMakeLists.txt?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.
This does not work, because it would also affect autotools ports
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.
Ping @Neumann-A for reply.
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.
Can you declare more?
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 also don't see why autotools should break with the additional flags. In general vcpkg should avoid adding additional flags in
vcpkg_configure_scripts.Uh oh!
There was an error while loading. Please reload this page.
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.
Now we have:
With -arch and -isysroot applied twice.
Conclusion: the current state of this PR is correct.
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 don't share that conclusion.
The reason that is happening is because the common makefile has something along the line
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS). Which of course doubles the flags.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.
Which common make file do you reference?
What do you propose as an alternative solution?
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.
All the flags should be extract from cmake:
vcpkg/scripts/cmake/vcpkg_configure_meson.cmake
Line 383 in 5ef52b5
Therefore, the behavor of cmake, make, qmake and meson etc. should be same.
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.
Sure, this is already the case.
The issue here is that cmake and autotools take these flags from the c flags and pass them to the linker. Meson does not do it and require a special handlung.
I have demonstrated that the requested solution does apply the flags twice. The current state of the PR passes the right number of flags as desired.
qmake is out of scope, because it does not use z_vcpkg_get_cmake_vars
If you have an alternative solution in mind that works as well, please propose.