Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-cpplib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-cpplib
Commits
bae8f8ac
Verified
Commit
bae8f8ac
authored
3 years ago
by
Timm Fitschen
Browse files
Options
Downloads
Plain Diff
Merge branch 'f-pedantic' into f-error-handling
parents
824082f8
5cd7533c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!3
Better Error Handling and Logging
Pipeline
#10877
passed
3 years ago
Stage: info
Stage: setup
Stage: test
Stage: deploy
Pipeline: caosdb-cppinttest
#10878
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
.gitlab-ci.yml
+3
-0
3 additions, 0 deletions
.gitlab-ci.yml
CMakeLists.txt
+12
-2
12 additions, 2 deletions
CMakeLists.txt
README_SETUP.md
+13
-0
13 additions, 0 deletions
README_SETUP.md
conanfile.py
+1
-1
1 addition, 1 deletion
conanfile.py
test/CMakeLists.txt
+6
-3
6 additions, 3 deletions
test/CMakeLists.txt
with
35 additions
and
6 deletions
.gitlab-ci.yml
+
3
−
0
View file @
bae8f8ac
...
...
@@ -83,6 +83,9 @@ test:
-
mkdir build
-
cd build
-
conan install .. -s "compiler.libcxx=libstdc++11"
-
FILE_TO_BE_PATCHED="$(grep "std::unique_ptr<ContextAllocator> context_allocator) {}" -l -r $(conan config home))"
-
echo "FILE_TO_BE_PATCHED=$FILE_TO_BE_PATCHED"
-
sed -e "s|std::unique_ptr<ContextAllocator> context_allocator) {}|std::unique_ptr<ContextAllocator> /*context_allocator*/) {}|" -i $FILE_TO_BE_PATCHED
-
cmake -DCMAKE_BUILD_TYPE=Debug ..
-
cmake --build .
-
cmake --build . --target unit_test_coverage
...
...
This diff is collapsed.
Click to expand it.
CMakeLists.txt
+
12
−
2
View file @
bae8f8ac
...
...
@@ -41,6 +41,10 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
set
(
CMAKE_MODULE_PATH
"
${
PROJECT_SOURCE_DIR
}
/cmake"
${
CMAKE_MODULE_PATH
}
)
IF
(
WIN32
)
set
(
CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON
)
ENDIF
()
###########################################
### DEPENDENCY MANAGEMENT with CONAN
###########################################
...
...
@@ -79,8 +83,13 @@ set(PROTO_FILES
set
(
PROTO_PATH
${
PROJECT_SOURCE_DIR
}
/proto/proto
)
# compiler binaries
set
(
_PROTOBUF_PROTOC
"
${
CMAKE_BINARY_DIR
}
/build_tools/protoc"
)
set
(
_GRPC_CPP_PLUGIN_EXECUTABLE
"
${
CMAKE_BINARY_DIR
}
/build_tools/grpc_cpp_plugin"
)
IF
(
WIN32
)
set
(
_PROTOBUF_PROTOC
"
${
CMAKE_BINARY_DIR
}
/build_tools/protoc.exe"
)
set
(
_GRPC_CPP_PLUGIN_EXECUTABLE
"
${
CMAKE_BINARY_DIR
}
/build_tools/grpc_cpp_plugin.exe"
)
ELSE
()
set
(
_PROTOBUF_PROTOC
"
${
CMAKE_BINARY_DIR
}
/build_tools/protoc"
)
set
(
_GRPC_CPP_PLUGIN_EXECUTABLE
"
${
CMAKE_BINARY_DIR
}
/build_tools/grpc_cpp_plugin"
)
ENDIF
()
# Generated sources
list
(
LENGTH PROTO_FILES len_proto_files
)
...
...
@@ -248,6 +257,7 @@ if(_LINTING)
add_compiler_flag
(
"-pedantic"
)
add_compiler_flag
(
"-Werror"
)
message
(
STATUS
"PEDANTIC_CMAKE_CXX_FLAGS: [
${
PEDANTIC_CMAKE_CXX_FLAGS
}
]"
)
set
(
TARGET_CAOSDB_COMPILE_FLAGS
"
${
TARGET_CAOSDB_COMPILE_FLAGS
}
${
PEDANTIC_CMAKE_CXX_FLAGS
}
"
)
set
(
TARGET_CCAOSDB_COMPILE_FLAGS
"
${
TARGET_CCAOSDB_COMPILE_FLAGS
}
${
PEDANTIC_CMAKE_C_FLAGS
}
"
)
set
(
TARGET_CXXCAOSDBCLI_COMPILE_FLAGS
"
${
TARGET_CXXCAOSDBCLI_COMPILE_FLAGS
}
${
PEDANTIC_CMAKE_CXX_FLAGS
}
"
)
...
...
This diff is collapsed.
Click to expand it.
README_SETUP.md
+
13
−
0
View file @
bae8f8ac
...
...
@@ -33,6 +33,19 @@ have to add `build/lib/` (or, alternatively after installation,
`CMAKE_INSTALL_PREFIX/lib`
) to your
`DYLD_LIBRARY_PATH`
environmental
variable.
### How to build on Windows
We use
[
Visual Studio 2019
](
https://visualstudio.microsoft.com/de/vs/features/cplusplus/
)
as compiler. We use
[
cmake
](
https://cmake.org/download/
)
as build tool.
1.
`mkdir build`
2.
`cd build`
3.
`conan install .. -g visual_studio -s arch=x86_64 -s build_type=Release -s compiler.toolset=v142 -s compiler.version=16 -s compiler.runtime=MD --build=missing --update`
4.
`cmake -B . ..`
5.
open
` libcaosdb.sln`
with Visual Studio, change the buildtype to
`Release`
and build the project. (You can open Tools/Command Line/Developer Command
Prompt and execute
`msbuild libcaosdb.sln /property:Configuration=Release`
)
## Unit Tests
### Build
...
...
This diff is collapsed.
Click to expand it.
conanfile.py
+
1
−
1
View file @
bae8f8ac
...
...
@@ -28,7 +28,7 @@ class CaosdbConan(ConanFile):
def
imports
(
self
):
self
.
copy
(
"
protoc*
"
,
"
build_tools
"
,
"
bin
"
)
self
.
copy
(
"
grpc_cpp_plugin
"
,
"
build_tools
"
,
"
bin
"
)
self
.
copy
(
"
grpc_cpp_plugin
*
"
,
"
build_tools
"
,
"
bin
"
)
def
build
(
self
):
cmake
=
CMake
(
self
)
...
...
This diff is collapsed.
Click to expand it.
test/CMakeLists.txt
+
6
−
3
View file @
bae8f8ac
...
...
@@ -82,6 +82,7 @@ include(CodeCoverage)
if
(
LCOV_PATH
)
message
(
STATUS
"Found LCOV:
${
LCOV_PATH
}
"
)
target_link_libraries
(
caosdb gcov
)
target_link_libraries
(
ccaosdb gcov
)
setup_target_for_coverage_lcov
(
NAME unit_test_coverage
EXECUTABLE ctest -L caosdb-cpplib-unit-tests
...
...
@@ -91,11 +92,13 @@ if (LCOV_PATH)
GENHTML_ARGS --rc lcov_branch_coverage=1
)
message
(
STATUS
"Adding COMPILE_FLAGS for coverage:
${
COVERAGE_COMPILER_FLAGS
}
"
)
set
(
TARGET_CAOSDB_COMPILE_FLAGS
"
${
TARGET_CAOSDB_COMPILE_FLAGS
}
${
COVERAGE_COMPILER_FLAGS
}
"
PARENT_SCOPE
)
set
(
TARGET_CCAOSDB_COMPILE_FLAGS
"
${
TARGET_CCAOSDB_COMPILE_FLAGS
}
${
COVERAGE_COMPILER_FLAGS
}
"
PARENT_SCOPE
)
set
(
TARGET_CAOSDB_COMPILE_FLAGS
"
${
TARGET_CAOSDB_COMPILE_FLAGS
}
${
COVERAGE_COMPILER_FLAGS
}
"
)
set
(
TARGET_CCAOSDB_COMPILE_FLAGS
"
${
TARGET_CCAOSDB_COMPILE_FLAGS
}
${
COVERAGE_COMPILER_FLAGS
}
"
)
set
(
TARGET_CAOSDB_COMPILE_FLAGS
${
TARGET_CAOSDB_COMPILE_FLAGS
}
PARENT_SCOPE
)
set
(
TARGET_CCAOSDB_COMPILE_FLAGS
${
TARGET_CCAOSDB_COMPILE_FLAGS
}
PARENT_SCOPE
)
set_target_properties
(
caosdb PROPERTIES
COMPILE_FLAGS
"
${
TARGET_CAOSDB_COMPILE_FLAGS
}
"
)
set_target_properties
(
caosdb PROPERTIES
set_target_properties
(
c
caosdb PROPERTIES
COMPILE_FLAGS
"
${
TARGET_CCAOSDB_COMPILE_FLAGS
}
"
)
else
()
message
(
WARNING
"Could not generate code coverage report. Please install lcov."
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment