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

Generate OBJECT library instead of STATIC #28

Closed
drdanz opened this issue Jun 30, 2021 · 1 comment · Fixed by #30
Closed

Generate OBJECT library instead of STATIC #28

drdanz opened this issue Jun 30, 2021 · 1 comment · Fixed by #30

Comments

@drdanz
Copy link
Contributor

drdanz commented Jun 30, 2021

When installing a STATIC library that includes files using cmrc_add_resource_library, it is necessary to export and install the library generated by CMakeRC as well. This shouldn't be necessary.
An option would be to generate an OBJECT library instead of a STATIC library, and to use it with target_sources and target_include_directories instead of linking it with target_link_libraries

@drdanz
Copy link
Contributor Author

drdanz commented Jun 30, 2021

Actually after a few tests, I think that instead of

target_link_libraries(my-program PRIVATE foo::rc)

it is already possible to use

target_sources(my-program PRIVATE $<TARGET_OBJECTS:foo::rc>)
target_include_directories(my-program PRIVATE $<TARGET_PROPERTY:foo::rc,INTERFACE_INCLUDE_DIRECTORIES>)

even if this is a static library.

If I understand correctly, the only difference is that using OBJECT will not create an actual static library.

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 a pull request may close this issue.

1 participant