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

Library is built twice #34

Open
sergiogf93 opened this issue Nov 1, 2021 · 3 comments
Open

Library is built twice #34

sergiogf93 opened this issue Nov 1, 2021 · 3 comments

Comments

@sergiogf93
Copy link

When using this library as a dependency called from a higher CMakeLists, when compiling with ninja an error is raised because the library is built both as a shared and a static library:

https://github.com/videolabs/libspatialaudio/blob/master/CMakeLists.txt#L15

Is there a way to avoid this and have it only built as shared for example?

@sergiogf93
Copy link
Author

Ah it seems I can overcome it by defining

set(BUILD_SHARED_LIBS OFF)

on the parent CMakeLists

@sergiogf93 sergiogf93 reopened this Nov 2, 2021
@sergiogf93
Copy link
Author

Well, I notice that I need BUILD_SHARED_LIBS ON for the parent CMakeLists

@Stan230211
Copy link

I am having the same issue here. As we are integrating libspatialaudio through git submodule, any usage of global cmake flag (specifically, BUILD_SHARED_LIBS and BUILD_STATIC_LIBS) could lead to destructive conflicts to our project.

There seems to be a logical flaw as your team keep both default values to ON here

option(BUILD_SHARED_LIBS "Build shared library" ON)
option(BUILD_STATIC_LIBS "Build static library" ON)

The ninja compiler of Visual Studio 2019 will error out saying there are multiple build rules for libspatialaudio

If setting these Cmake options both ON are your intention, did you consider using a private option like BUILD_SPATIALAUDIO_AS_SHARED_LIBS and BUILD_SPATIALAUDIO_AS_STATIC_LIBS?

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

2 participants