You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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 theadd_library
call, it treats it as a stringadd_library(curlcpp ${BUILD_SHARED_LIBS}
as theadd_library
function expects one of [SHARED
,STATIC
,INTERFACE
,MODULE
]. This causes the build to fail asadd_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 asBUILD_SHARED_LIBS
is a global cmake variable.add_library
can be called without the modifier and ifBUILD_SHARED_LIBS
is set, you will get aSHARED
library, otherwise you will get aSTATIC
library.The text was updated successfully, but these errors were encountered: