[cmake] refactor: shared/static handling#6481
Open
crueter wants to merge 2 commits intoKhronosGroup:mainfrom
Open
[cmake] refactor: shared/static handling#6481crueter wants to merge 2 commits intoKhronosGroup:mainfrom
crueter wants to merge 2 commits intoKhronosGroup:mainfrom
Conversation
This significantly redoes the way shared and static libraries are
handled. Now, it's controlled by two options: `SPIRV_TOOLS_BUILD_STATIC`
and `SPIRV_TOOLS_BUILD_SHARED`.
The default configuration (no `BUILD_SHARED_LIBS` set, options left at
default) is to build shared ONLY if this is the master project, or
static ONLY if this is a subproject (e.g. FetchContent, CPM.cmake). Also
I should note that static-only (i.e. no shared) is now a supported
target, this is done because projects including it as a submodule e.g.
on Android or Windows may prefer this.
Now the shared/static handling:
- static ON, shared OFF: Only generates `.a` libraries.
- static ON, shared ON: Generates `.a` libraries, but also
`libSPIRV-Tools.so`
- static OFF, shared ON: Only generates `.so` libraries.
Notable TODOs:
- SPIRV-Tools-shared.pc seems redundant--how should we handle which one
to use in the case of distributions that distribute both types (MSYS2
for instance)?
* *Note: pkgconfig sucks at this and usually just leaves it up to the
user, so the optimal solution may indeed be doing absolutely
nothing.* CMake is unaffected :)
- use namespaces in the CMake config files pleaaaaase
This is going to change things a good bit for package maintainers, but
cest la vie. It's for the greater good, I promise.
Signed-off-by: crueter <[email protected]>
Signed-off-by: crueter <[email protected]>
|
|
Author
|
done a bit of studying on PC files... I think the way to go is utilizing Libs.private |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This significantly redoes the way shared and static libraries are
handled. Now, it's controlled by two options:
SPIRV_TOOLS_BUILD_STATICand
SPIRV_TOOLS_BUILD_SHARED.The default configuration (no
BUILD_SHARED_LIBSset, options left atdefault) is to build shared ONLY if this is the master project, or
static ONLY if this is a subproject (e.g. FetchContent, CPM.cmake). Also
I should note that static-only (i.e. no shared) is now a supported
target, this is done because projects including it as a submodule e.g.
on Android or Windows may prefer this.
Now the shared/static handling:
.alibraries..alibraries, but alsolibSPIRV-Tools.so.solibraries.Notable TODOs:
to use in the case of distributions that distribute both types (MSYS2
for instance)?
user, so the optimal solution may indeed be doing absolutely
nothing. CMake is unaffected :)
This is going to change things a good bit for package maintainers, but
cest la vie. It's for the greater good, I promise.
Signed-off-by: crueter [email protected]