-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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_configure_make] Fix handling of link flags #22798
Conversation
This is not recommended during the normal build process https://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html
cc @Neumann-A for review this changes. |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
colmap:x64-osx regression will be fixed in another PR. |
@Neumann-A Any other suggestions? |
i already left all my comments and the bugs are fixed. so no? |
Thanks for fixing what looks like it was a very tricky ball of wax to dig through! I can't believe the I hate that this is messing with |
if(EXISTS "${Z_VCPKG_INSTALLED}${path_suffix}/lib") | ||
string(APPEND LDFLAGS_${cmake_buildtype} " -L${Z_VCPKG_INSTALLED}${path_suffix}/lib") | ||
endif() | ||
if(EXISTS "${Z_VCPKG_INSTALLED}${path_suffix}/lib/manual-link") | ||
string(APPEND LDFLAGS_${cmake_buildtype} " -L${Z_VCPKG_INSTALLED}${path_suffix}/lib/manual-link") | ||
endif() |
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 is clearly an improvement vs. the status quo so I'm merging it, however, shouldn't this be:
if(EXISTS "${Z_VCPKG_INSTALLED}${path_suffix}/lib") | |
string(APPEND LDFLAGS_${cmake_buildtype} " -L${Z_VCPKG_INSTALLED}${path_suffix}/lib") | |
endif() | |
if(EXISTS "${Z_VCPKG_INSTALLED}${path_suffix}/lib/manual-link") | |
string(APPEND LDFLAGS_${cmake_buildtype} " -L${Z_VCPKG_INSTALLED}${path_suffix}/lib/manual-link") | |
endif() | |
if(EXISTS "${Z_VCPKG_INSTALLED}${path_suffix}/lib") | |
string(APPEND LDFLAGS_${cmake_buildtype} " -L\"${Z_VCPKG_INSTALLED}${path_suffix}/lib\"") | |
endif() | |
if(EXISTS "${Z_VCPKG_INSTALLED}${path_suffix}/lib/manual-link") | |
string(APPEND LDFLAGS_${cmake_buildtype} " -L\"${Z_VCPKG_INSTALLED}${path_suffix}/lib/manual-link"") | |
endif() | |
or something like that? (I'm not sure what syntax is is strictly speaking correct here but I suspect we should be defending against spaces)
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.
It looks like the diff is confused. All I did was add quotes, changing:
"-L${Z_VCPKG_INSTALLED}${path_suffix}/lib/manual-link"
to
"-L\"${Z_VCPKG_INSTALLED}${path_suffix}/lib/manual-link\""
This fixes the handling of link flags for Autotools ports, a prerequisite for #22516
What does your PR fix?
Which triplets are supported/not supported? Have you updated the CI baseline?
No change
Does your PR follow the maintainer guide?
Yes
If you have added/updated a port: Have you run
./vcpkg x-add-version --all
and committed the result?not required