Skip to content

cmake: use target_link_options() when available #17670

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

Closed
wants to merge 5 commits into from

Conversation

vszakats
Copy link
Member

@vszakats vszakats commented Jun 19, 2025

To pass -municode to the linker. Before this patch we passed this via
target_link_libraries() which is designed to pass libraries. Keep
using it for old CMake versions, where no better alternative existed.

https://cmake.org/cmake/help/latest/command/target_link_options.html

Also:

  • also pass -municode as PRIVATE for old cmake versions.
    (it should not make a difference because no target depends on the curl
    tool, but this seem to be the modern, non-ambiguous syntax.)
  • unfold a bunch of split lines for greppability of add_library() and
    add_executable() commands.
  • quote a string.

To pass `-municode` to the linker. Before this patch we passed this via
`target_link_libraries()` which is designed to pass libraries. Keep
using it for old CMake versions, where no better alternative existed.

https://cmake.org/cmake/help/latest/command/target_link_options.html
@vszakats vszakats closed this in 5488739 Jun 19, 2025
@vszakats vszakats deleted the cm-use-target_link_options branch June 19, 2025 11:03
denandz pushed a commit to denandz/curl that referenced this pull request Jun 21, 2025
To pass `-municode` to the linker. Before this patch we passed this via
`target_link_libraries()` which is designed to pass libraries. Keep
using it for old CMake versions, where no better alternative existed.

https://cmake.org/cmake/help/latest/command/target_link_options.html

Also:
- also pass `-municode` as `PRIVATE` for old cmake versions.
  (it should not make a difference because no target depends on the curl
  tool, but this seem to be the modern, non-ambiguous syntax.)
- unfold a bunch of split lines for greppability of `add_library()` and
  `add_executable()` commands.
- quote a string.

Closes curl#17670
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

1 participant