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

Export CMake libraries with aliases for easy use #675

Closed
wants to merge 1 commit into from

Conversation

jeaye
Copy link
Contributor

@jeaye jeaye commented Nov 1, 2024

This allows bdwgc to be included in a CMake build using add_subdirectory, FetchContent, or similar. It then relies on this CMake policy to ensure the library is found in any target_link_libraries usage: https://cmake.org/cmake/help/latest/policy/CMP0028.html

Without the alias, target_link_libraries will not be able to find gc, gccpp, etc.

More info here: https://stackoverflow.com/a/77211132

This allows bdwgc to be included in a CMake build using
`add_subdirectory`, `FetchContent`, or similar. It then relies on this
CMake policy to ensure the library is found in any `target_link_libraries`
usage: https://cmake.org/cmake/help/latest/policy/CMP0028.html

Without the alias, `target_link_libraries` will not be able to find
`gc`, `gccpp`, etc.

More info here: https://stackoverflow.com/a/77211132
@ivmai
Copy link
Owner

ivmai commented Nov 1, 2024

LGTM. Will be merged in a day.

ivmai pushed a commit that referenced this pull request Nov 1, 2024
PR #675 (bdwgc).

This allows bdwgc to be included in a cmake build using
`add_subdirectory`, `FetchContent`, or similar.  It then relies on the
CMake CMP0028 policy to ensure the library is found in any
`target_link_libraries` usage.

Without the alias, `target_link_libraries` will not be able to find
`gc`, `gccpp`, etc.

* CMakeLists.txt (add_library): Specify alias for gc.
* CMakeLists.txt [enable_cplusplus] (add_library): Specify alias for
gccpp.
* CMakeLists.txt [enable_cplusplus && enable_throw_bad_alloc_library]
(add_library): Specify alias for gctba.
* CMakeLists.txt [build_cord] (add_library): Specify alias for cord.
@ivmai
Copy link
Owner

ivmai commented Nov 1, 2024

Merged.

@ivmai ivmai closed this Nov 1, 2024
@jeaye
Copy link
Contributor Author

jeaye commented Nov 1, 2024

Thanks, Ivan!

ivmai pushed a commit that referenced this pull request Dec 27, 2024
(a cherry-pick of commit 1b04347 from 'master')

PR #675 (bdwgc).

This allows bdwgc to be included in a cmake build using
`add_subdirectory`, `FetchContent`, or similar.  It then relies on the
CMake CMP0028 policy to ensure the library is found in any
`target_link_libraries` usage.

Without the alias, `target_link_libraries` will not be able to find
`gc`, `gccpp`, etc.

* CMakeLists.txt (add_library): Specify alias for gc.
* CMakeLists.txt [enable_cplusplus] (add_library): Specify alias for
gccpp.
* CMakeLists.txt [enable_cplusplus && enable_throw_bad_alloc_library]
(add_library): Specify alias for gctba.
* CMakeLists.txt [build_cord] (add_library): Specify alias for cord.
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.

2 participants