Skip to content
Snippets Groups Projects
Verified Commit 6d44f8a7 authored by Timm Fitschen's avatar Timm Fitschen
Browse files

WIP: conan

parent 65c53b94
No related branches found
No related tags found
No related merge requests found
Pipeline #9922 passed
Pipeline: caosdb-cppinttest

#9930

    ......@@ -84,7 +84,7 @@ test:
    script:
    - mkdir build
    - cd build
    - conan install .. --profile ../conan.profile
    - conan install .. -s "compiler.libcxx=libstdc++11"
    - cmake -DCMAKE_BUILD_TYPE=Debug ..
    - cmake --build .
    - cmake --build . --target unit_test_coverage
    ......@@ -129,7 +129,7 @@ trigger_inttest:
    script:
    - mkdir -p build
    - cd build
    - conan install .. --profile ../conan.profile
    - conan install .. -s "compiler.libcxx=libstdc++11"
    - cmake ..
    - cmake --build . --target doc-sphinx
    - cp -r doc/sphinx_out ../public
    ......
    ......@@ -5,61 +5,9 @@
    We use [cmake](https://cmake.org) as build tool.
    1. `mkdir build && cd build/`
    2. `cmake -B . ..`
    3. `cmake --build .`
    ### Troubleshooting
    #### protobufConfig.cmake not found
    If you encounter something like `protobufConfig.cmake not found` when doing
    `cmake -B . ..` your system doesn't have the gRPC library installed at all
    or your installation doesn't have the required `protobufConfig.cmake`
    file. In this case you can install grpcc manually by cloning the
    repository and its submodules nad building it from the sources:
    ```sh
    RUN git clone --recurse-submodules -b v1.38.1 https://github.com/grpc/grpc
    cd grpc
    mkdir -p cmake/build
    cp cmake/build
    cmake -DgRPC_INSTALL=ON \
    -DgRPC_BUILD_CSHARP_EXT=OFF \
    -DgRPC_BUILD_GRPC_CSHARP_PLUGIN=OFF \
    -DgRPC_BUILD_GRPC_PYTHON_PLUGIN=OFF \
    -DgRPC_BUILD_GRPC_RUBY_PLUGIN=OFF \
    -DgRPC_BUILD_GRPC_PHP_PLUGIN=OFF \
    -DgRPC_BUILD_GRPC_OBJECTIVE_C_PLUGIN=OFF \
    -DgRPC_BUILD_GRPC_NODE_PLUGIN=OFF \
    -DgRPC_BUILD_TESTS=OFF \
    ../..
    make -j3 # Or whatever number of jobs suits your system
    make install
    ```
    It may make sense to specify a custom directory for your grpc
    installation such as `$HOME/.local` by adding
    `-DCMAKE_INSTALL_PREFIX=/path/to/install/dir` to the above `cmake`
    command. This prevents interference with a possible system-wide
    installation of grpc that's lacking the relevant cmake files.
    Depending on your system, it may be necessary to manually install the
    `abseil` submodule:
    ```sh
    cd grpc
    mkdir -p third_party/abseil-cpp/cmake/build
    cd third_party/abseil-cpp/cmake/build
    cmake -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE ../..
    make -j3
    make install
    ```
    As above, it may make sense to specify a `CMAKE_INSTALL_PREFIX` in
    order to not interfere with system-wide installations.
    You may have to repeat this for other submodules that haven't been
    installed correctly by `make install` of `grpc`.
    2. `conan install .. -s "compiler.libcxx=libstdc++11"`
    3. `cmake -B . ..`
    4. `cmake --build .`
    ## Unit Tests
    ......@@ -68,22 +16,14 @@ installed correctly by `make install` of `grpc`.
    For the tests there is a slightly different setup required (with option `-D CMAKE_BUILD_TYPE=Debug`)
    1. `mkdir build && cd build/`
    2. `cmake -B . -D CMAKE_BUILD_TYPE=Debug ..`
    3. `cmake --build .`
    2. `conan install .. -s "compiler.libcxx=libstdc++11"`
    3. `cmake -B . -D CMAKE_BUILD_TYPE=Debug ..`
    4. `cmake --build .`
    ### Run
    In the build directory, run `ctest`
    ### Troubleshooting
    Depending on your gtest installation, there may be warnings treated as
    errors during the above build command, e.g., a
    `-Werror=maybe-uninitialized` in
    `caosdb-cpplib-new/build/_deps/googletest-src/googletest/src/gtest-death-test.cc`. In
    that case, suppress the corresponding warning by adding
    `-DCMAKE_CXX_FLAGS="-Wno-maybe-uninitialized"` to the cmake command in 2.
    ### Framework
    We use [GoogleTest](https://google.github.io/googletest/) for unit testing.
    ......
    [settings]
    os=Linux
    os_build=Linux
    arch=x86_64
    arch_build=x86_64
    compiler=gcc
    compiler.version=8
    compiler.libcxx=libstdc++11
    build_type=Release
    [options]
    [build_requires]
    [env]
    ......@@ -32,7 +32,8 @@ namespace caosdb::utils {
    /**
    * @brief Read a text file into a string and return the file's content.
    * @todo use boost-filesystem's "load_string_file"!
    *
    * TODO use boost-filesystem's "load_string_file"!
    */
    inline auto load_string_file(const std::string &path) -> std::string {
    const auto path_view = std::string_view{path};
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment