diff --git a/CMakeLists.txt b/CMakeLists.txt index a77ba6851fe28305b68c77ecf4a53145245ab67f..7556d307ff2dbcdef235834f6bab76857cbbd6eb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,7 +35,7 @@ project(liblinkahead set(CMAKE_C_STANDARD 11) set(CMAKE_CXX_STANDARD 17) - +set(CMAKE_POSITION_INDEPENDENT_CODE ON) set(CMAKE_C_EXTENSIONS OFF) set(CMAKE_C_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) @@ -145,11 +145,22 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}/include) ############################################################################### find_package(gRPC CONFIG REQUIRED) -find_package(Boost COMPONENTS json REQUIRED) -find_package(Boost COMPONENTS filesystem REQUIRED) -find_package(Boost COMPONENTS log REQUIRED) -find_package(Boost COMPONENTS thread REQUIRED) -find_package(Boost COMPONENTS system REQUIRED) + +# boost +find_package(Boost REQUIRED COMPONENTS json filesystem log thread system log_setup) +# find_package(Boost REQUIRED COMPONENTS filesystem ) +# find_package(Boost REQUIRED COMPONENTS log ) +# find_package(Boost REQUIRED COMPONENTS thread ) +# find_package(Boost REQUIRED COMPONENTS system ) + +# Boost settings +set(Boost_USE_STATIC_LIBS ON) # only find static libs +set(Boost_USE_DEBUG_LIBS OFF) # ignore debug libs and +set(Boost_USE_RELEASE_LIBS ON) # only find release libs +set(Boost_USE_MULTITHREADED ON) +set(Boost_USE_STATIC_RUNTIME ON) # link Boost Static libraries + + find_package(GTest REQUIRED) # print include directories for debugging diff --git a/Makefile b/Makefile index 368cb1b8a5f9629586cdf1dfe93d3ebdfbd213aa..d807cfa10f5e12352f6b50e489e2719e19634f0e 100644 --- a/Makefile +++ b/Makefile @@ -117,7 +117,7 @@ vcpkg-build-release: vcpkg-install mkdir -p build/build_tools\ && cp vcpkg_installed/x64-linux/tools/grpc/grpc_cpp_plugin build/build_tools\ && cd build\ - && cmake -S .. -B . -DCMAKE_TOOLCHAIN_FILE=../vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-linux -DCMAKE_BUILD_TYPE=Release\ + && cmake -S .. -B . -DCMAKE_TOOLCHAIN_FILE=../vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-linux-release -DCMAKE_BUILD_TYPE=Release\ && cmake --build . .PHONY: vcpkg-build-release diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 6497de6bd54eb4de357202116d9dd472163d5b1d..7b70f9f14fcb0594f166713bee5821a96ae2f029 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -51,7 +51,7 @@ set(_CMAKE_CXX_CLANG_TIDY_TEST_CHECKS ) # add special cmake functions for gtest -find_package(GTest REQUIRED) +find_package(GTest CONFIG REQUIRED) include(GoogleTest) message(DEBUG "CMAKE_INCLUDE_PATH: ${CMAKE_INCLUDE_PATH}") @@ -65,7 +65,7 @@ foreach (i RANGE "${len_test_cases}") set(liblinkahead_TEST_SRC "${CMAKE_CURRENT_SOURCE_DIR}/${test_case_name}.cpp ${liblinkahead_TEST_SRC}") target_link_libraries(${test_case_name} - PRIVATE GTest::gtest_main linkahead clinkahead gtest::gtest caosdb_grpc) + PRIVATE GTest::gtest_main linkahead clinkahead GTest::gtest caosdb_grpc ${Boost_LIBRARIES}) target_include_directories(${test_case_name} PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/include ${CMAKE_CURRENT_BINARY_DIR}) set_target_properties(${test_case_name} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}") diff --git a/test/test_clinkahead.cpp b/test/test_clinkahead.cpp index 0cd8afb95c9aee1e51c069b0408b426eb9893522..a46f41e0dec8bfe20eb80c3ac72b9605192f4ccd 100644 --- a/test/test_clinkahead.cpp +++ b/test/test_clinkahead.cpp @@ -20,9 +20,7 @@ * */ -#include <gtest/gtest-message.h> // for Message -#include <gtest/gtest-test-part.h> // for TestPartResult -#include <gtest/gtest_pred_impl.h> // for AssertionResult, EXPECT_EQ, EXP... +#include <gtest/gtest.h> #include <cstdint> // for int64_t #include <cstring> // for strcmp #include <filesystem> // for path diff --git a/test/test_configuration.cpp b/test/test_configuration.cpp index 18c102806b51f34a264adb976efb460b487a1a66..b2cc95f3e410ec72ced509a7d608dedc929c1592 100644 --- a/test/test_configuration.cpp +++ b/test/test_configuration.cpp @@ -19,6 +19,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. * */ +#include <gtest/gtest.h> // for Test, TestPartResult, TestPartR... #include <gtest/gtest-message.h> // for Message #include <gtest/gtest-test-part.h> // for TestPartResult #include <gtest/gtest_pred_impl.h> // for TestInfo, TEST_F, Test diff --git a/test/test_connection.cpp b/test/test_connection.cpp index 07db64a5884c8777c88fd879a026bfd2fbf9aebc..2b92e94a4d098137f7879469a83dac5a3131406e 100644 --- a/test/test_connection.cpp +++ b/test/test_connection.cpp @@ -22,6 +22,7 @@ #ifdef BUILD_ACM #include "linkahead/acm/user.h" // for User #endif +#include <gtest/gtest.h> // for Test, TestPartResult, Test #include <gtest/gtest-message.h> // for Message #include <gtest/gtest-test-part.h> // for TestPartResult #include <gtest/gtest_pred_impl.h> // for AssertionResult, TestInfo diff --git a/test/test_data_type.cpp b/test/test_data_type.cpp index 08799d48e8e1db07ef66c158a92e5ca8e4735245..272f373e07277fd2808c65727c5e4b20aa96b98f 100644 --- a/test/test_data_type.cpp +++ b/test/test_data_type.cpp @@ -19,7 +19,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. * */ - +#include <gtest/gtest.h> // for TEST, EXPECT_EQ, EXPECT_FALSE, ... #include <gtest/gtest-message.h> // for Message #include <gtest/gtest-test-part.h> // for TestPartResult #include <gtest/gtest_pred_impl.h> // for AssertionResult, Test, EXPECT_EQ diff --git a/test/test_entity.cpp b/test/test_entity.cpp index 3eab1a764d5834b70129cd308387af327b5cfb97..6c5c4a7b8315404f73d04d3e76102f8d6733ed37 100644 --- a/test/test_entity.cpp +++ b/test/test_entity.cpp @@ -21,6 +21,7 @@ * */ #include <google/protobuf/arena.h> // for Arena +#include <gtest/gtest.h> // for Test, TestPartResult, Test #include <gtest/gtest-message.h> // for Message #include <gtest/gtest-test-part.h> // for TestPartResult #include <gtest/gtest_pred_impl.h> // for Test, EXPECT_EQ, Assertio... diff --git a/test/test_file_transmission.cpp b/test/test_file_transmission.cpp index ce5173538b540e045c9dc96994d9435d2484ceb0..12917317e5f47b2af0746b47ec94d7e208ce4a15 100644 --- a/test/test_file_transmission.cpp +++ b/test/test_file_transmission.cpp @@ -17,9 +17,7 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -#include <gtest/gtest-message.h> // for Message -#include <gtest/gtest-test-part.h> // for TestPartResult -#include <gtest/gtest_pred_impl.h> // for AssertionResult +#include <gtest/gtest.h> #include <filesystem> // for path, exists #include <string> // for basic_string #include "linkahead/file_transmission/file_reader.h" // for FileReader diff --git a/test/test_info.cpp b/test/test_info.cpp index 2e77754b3b29551b145e659ae4a728fb6867dd36..fc6fd3a694d9e867d08fd335704323a15e27be87 100644 --- a/test/test_info.cpp +++ b/test/test_info.cpp @@ -20,8 +20,7 @@ * */ -#include <gtest/gtest-message.h> // for Message -#include <gtest/gtest-test-part.h> // for TestPartResult +#include <gtest/gtest.h> #include "caosdb/info/v1/main.pb.h" // for VersionInfo #include "gtest/gtest_pred_impl.h" // for Test, EXPECT_EQ, TestInfo, TEST #include "linkahead/info.h" // for VersionInfo diff --git a/test/test_issues.cpp b/test/test_issues.cpp index 594eded6ff78d70508d0254a9d87aa8256e0894a..25b1a87fa539e0624b978f489ca1c251f0a528f2 100644 --- a/test/test_issues.cpp +++ b/test/test_issues.cpp @@ -17,9 +17,7 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -#include <gtest/gtest-message.h> // for Message -#include <gtest/gtest-test-part.h> // for TestPartResult -#include <gtest/gtest_pred_impl.h> // for Test, EXPECT_EQ, TestInfo +#include <gtest/gtest.h> #include <memory> // for unique_ptr #include <string> // for basic_string #include "linkahead/configuration.h" // for InsecureConnectionConfigur... diff --git a/test/test_list_properties.cpp b/test/test_list_properties.cpp index ec9c8f23c9f1fa3723b068bb0e15cf65bbb35095..8c8dfe287dd1e73a527e098aee4e75404f3b91f4 100644 --- a/test/test_list_properties.cpp +++ b/test/test_list_properties.cpp @@ -20,9 +20,7 @@ * */ -#include <gtest/gtest-message.h> // for Message -#include <gtest/gtest-test-part.h> // for TestPartResult -#include <gtest/gtest_pred_impl.h> // for AssertionResult, Test, EXPECT_... +#include <gtest/gtest.h> #include <cstdint> // for int64_t #include <string> // for basic_string, string #include <vector> // for vector diff --git a/test/test_protobuf.cpp b/test/test_protobuf.cpp index ab489ccc6833c445f03314117f28d75b275cfc2f..a49c205dd2f9ac03860d30ff6a315692751e0efe 100644 --- a/test/test_protobuf.cpp +++ b/test/test_protobuf.cpp @@ -19,10 +19,8 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. * */ -#include <google/protobuf/arena.h> // for Arena -#include <gtest/gtest-message.h> // for Message -#include <gtest/gtest-test-part.h> // for TestPartResult -#include <gtest/gtest_pred_impl.h> // for EXPECT_EQ, Test, TestInfo, TEST +#include <google/protobuf/arena.h> // for Arena +#include <gtest/gtest.h> #include "caosdb/entity/v1/main.pb.h" // for Entity, Message, Version, Data... #include "linkahead/data_type.h" // for DataType, ReferenceDataType #include "linkahead/entity.h" // for Entity diff --git a/test/test_transaction.cpp b/test/test_transaction.cpp index e41bcedb1fd5785ddd563833851d79730d443196..cb936c0dab7193178c9eaec132d429e7be2a5515 100644 --- a/test/test_transaction.cpp +++ b/test/test_transaction.cpp @@ -17,10 +17,8 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -#include <google/protobuf/arena.h> // for Arena -#include <gtest/gtest-message.h> // for Message -#include <gtest/gtest-test-part.h> // for TestPartResult -#include <gtest/gtest_pred_impl.h> // for Test, EXPECT_EQ, TestInfo +#include <google/protobuf/arena.h> // for Arena +#include <gtest/gtest.h> #include <filesystem> // for path #include <memory> // for unique_ptr, make_unique #include <stdexcept> // for out_of_range diff --git a/test/test_utility.cpp b/test/test_utility.cpp index c86da802fd26601aa29ef3da08e95c5dac469eb7..9880d1e830019091ca42cc25d1cf53f4cd89bb07 100644 --- a/test/test_utility.cpp +++ b/test/test_utility.cpp @@ -20,14 +20,12 @@ * */ -#include <gtest/gtest-message.h> // for Message -#include <gtest/gtest-test-part.h> // for TestPartResult -#include <gtest/gtest_pred_impl.h> // for Test, EXPECT_EQ, TestInfo +#include <gtest/gtest.h> #include <map> // for _Rb_tree_const_iterator #include <stdexcept> // for out_of_range #include <string> // for basic_string, string #include <utility> // for pair -#include "boost/beast/core/detail/base64.hpp" // for encoded_size +#include <boost/beast/core/detail/base64.hpp> // for encoded_size #include "linkahead/data_type.h" // for AtomicDataType, atomic... #include "linkahead/entity.h" // for Importance, Role, impo... #include "linkahead/status_code.h" // for get_status_description diff --git a/test/test_value.cpp b/test/test_value.cpp index b2770e5be303162d42ef2ea00ef42dce48f78efc..0dab4d657d6112961b3d5d7eb40e17effab04604 100644 --- a/test/test_value.cpp +++ b/test/test_value.cpp @@ -20,9 +20,7 @@ * */ -#include <gtest/gtest-message.h> // for Message -#include <gtest/gtest-test-part.h> // for TestPartResult -#include <gtest/gtest_pred_impl.h> // for AssertionResult, Test, EXPECT... +#include <gtest/gtest.h> #include <cmath> // for sqrt, isnan #include <initializer_list> // for initializer_list #include <string> // for basic_string, string, operator+