Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

BUILD_SHARED_LIBS non-standard usage. #154

Open
MitchellBot opened this issue Dec 7, 2023 · 0 comments
Open

BUILD_SHARED_LIBS non-standard usage. #154

MitchellBot opened this issue Dec 7, 2023 · 0 comments

Comments

@MitchellBot
Copy link

MitchellBot commented Dec 7, 2023

While building a SHARED lib version of curlcpp, we noticed that the src/CMakeLists.txt file utilizes the CMake variable ${BUILD_SHARED_LIBS} in a non-standard way. i.e., according to their documentation, this should be a boolean value. The src/CMakeLists.txt treats it that way initially (if(NOT BUILD_SHARED_LIBS)) but then in the add_library call, it treats it as a string add_library(curlcpp ${BUILD_SHARED_LIBS} as the add_library function expects one of [SHARED, STATIC, INTERFACE, MODULE]. This causes the build to fail as add_library(curlcpp ON ... is not a valid call resulting in the error "Cannot find source file: ON".

Note that this entire if block is unnecessary as BUILD_SHARED_LIBS is a global cmake variable. add_library can be called without the modifier and if BUILD_SHARED_LIBS is set, you will get a SHARED library, otherwise you will get a STATIC library.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant