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

cpp-library: setting multiple linkages only produces one #1105

Open
phreed opened this issue Mar 8, 2023 · 0 comments
Open

cpp-library: setting multiple linkages only produces one #1105

phreed opened this issue Mar 8, 2023 · 0 comments

Comments

@phreed
Copy link

phreed commented Mar 8, 2023

Expected Behavior

On https://docs.gradle.org/current/userguide/cpp_library_plugin.html#sec:cpp_library_build_variants it says...
"The linkage expresses whether a shared library or static library should be created. Libraries can produce a shared library, a static library or both."

Current Behavior

When I specify the following only the shared (build/lib/main/debug/shared/windows/*.[dll ilk pdb]) files are produced.

linkage.set(listOf(Linkage.STATIC, Linkage.SHARED))

When I specify the following only the static library (build/lib/main/debug/windows/*.lib) file is produced.

linkage.set(listOf(Linkage.STATIC))

Context

It is often useful to have both the static and shared library.

Steps to Reproduce (for bugs)

There is a github project https://github.com/phreed/sample-build-cpp-app-lib-kotlin-dsl/tree/master which demonstrates the issue.

./gradlew :myapp:assemble

There are three branches:

  • valid_app: This only has the static library and builds the app properly
  • main: This sets both the static and shared library and illustrates the problem
  • master: This version makes use of the add rather than the set function.

Your Environment

Windows 11 with VS Community 2017

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

No branches or pull requests

1 participant