Skip to content

Issue building couchbase-cxx-client in static #701

Open
@Thomas-Barbier-1A

Description

@Thomas-Barbier-1A

Hello,

I contact you because I am trying to build the client in static and I am facing some issues.

couchbase-cxx-client version 1.0.4 (tarball from https://github.com/couchbase/couchbase-cxx-client/releases/download/1.0.4/couchbase-cxx-client-1.0.4.tar.gz)

I am using the following cmake command

mkdir -p build
cmake -S "." -B build  \
    -DCMAKE_INSTALL_PREFIX=%{buildroot} \
    -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
    -DBUILD_SHARED_LIBS=OFF \
    -DCOUCHBASE_CXX_CLIENT_INSTALL=ON \
    -DCOUCHBASE_CXX_CLIENT_BUILD_EXAMPLES=OFF \
    -DCOUCHBASE_CXX_CLIENT_BUILD_TESTS=OFF \
    -DCOUCHBASE_CXX_CLIENT_BUILD_TOOLS=ON \
    -DCOUCHBASE_CXX_CLIENT_BUILD_STATIC=ON \
    -DCOUCHBASE_CXX_CLIENT_BUILD_SHARED=OFF

And I am getting the following errors:

CMake Error: install(EXPORT "couchbase_cxx_client-targets" ...) includes target "couchbase_cxx_client_static" which requires target "project_options" that is not in any export set.
CMake Error: install(EXPORT "couchbase_cxx_client-targets" ...) includes target "couchbase_cxx_client_static" which requires target "project_warnings" that is not in any export set.
CMake Error: install(EXPORT "couchbase_cxx_client-targets" ...) includes target "couchbase_cxx_client_static" which requires target "fmt" that is not in any export set.
CMake Error: install(EXPORT "couchbase_cxx_client-targets" ...) includes target "couchbase_cxx_client_static" which requires target "spdlog" that is not in any export set.
CMake Error: install(EXPORT "couchbase_cxx_client-targets" ...) includes target "couchbase_cxx_client_static" which requires target "GSL" that is not in any export set.
CMake Error: install(EXPORT "couchbase_cxx_client-targets" ...) includes target "couchbase_cxx_client_static" which requires target "asio" that is not in any export set.
CMake Error: install(EXPORT "couchbase_cxx_client-targets" ...) includes target "couchbase_cxx_client_static" which requires target "snappy" that is not in any export set.
CMake Error: install(EXPORT "couchbase_cxx_client-targets" ...) includes target "couchbase_cxx_client_static" which requires target "jsonsl" that is not in any export set.
CMake Error: install(EXPORT "couchbase_cxx_client-targets" ...) includes target "couchbase_cxx_client_static" which requires target "couchbase_backtrace" that is not in any export set.

If I build the client in shared it works fine

cmake -S "." -B build  \
    ${BuildTarget} -DCMAKE_INSTALL_PREFIX=%{buildroot} \
    -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
    -DBUILD_SHARED_LIBS=OFF \
    -DCOUCHBASE_CXX_CLIENT_INSTALL=ON \
    -DCOUCHBASE_CXX_CLIENT_BUILD_EXAMPLES=OFF \
    -DCOUCHBASE_CXX_CLIENT_BUILD_TESTS=OFF \
    -DCOUCHBASE_CXX_CLIENT_BUILD_TOOLS=ON \
    -DCOUCHBASE_CXX_CLIENT_BUILD_STATIC=OFF \
    -DCOUCHBASE_CXX_CLIENT_BUILD_SHARED=ON

Maybe I am using the wrong flags to build in static but I have the feeling there is some issues in the cmake files for the static build.
What triggers the issue seems to be the usage of both -DCOUCHBASE_CXX_CLIENT_INSTALL=ON and -DCOUCHBASE_CXX_CLIENT_BUILD_STATIC=ON

Can you please confirm that the cmake command I am using is correct to build in static and install the couchbase-cxx-client?

Cheers
Thomas

Note: I am sorry for creating the issue on Github but I cannot create an account on your Couchbase JIRA, there is only the option to sign in and if I sign in with my company or my personal account I have not access to your board.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions