Skip to content

BUILD_SHARED_LIBS non-standard usage.Β #154

@MitchellBot

Description

@MitchellBot

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions