From 31fe7a069192e24af231b444809499a9a59d7fc2 Mon Sep 17 00:00:00 2001 From: kyonRay Date: Thu, 14 Dec 2023 00:16:46 +0800 Subject: [PATCH] (build): fix boost uuid exception. --- CMakeLists.txt | 3 +++ test/testTransaction.cpp | 9 +++++++++ vcpkg-configuration.json | 5 +++-- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cba6832f8..c4a7415c8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,6 +33,9 @@ if (WIN32) add_definitions(-D_WIN32_WINNT=0x0601) add_definitions(-DBOOST_USE_WINAPI_VERSION=BOOST_WINAPI_VERSION_WIN7) set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS "ON") +else () + add_definitions(-DBOOST_UUID_RANDOM_PROVIDER_FORCE_POSIX=1) + add_definitions(-DBOOST_UUID_RANDOM_PROVIDER_SHOW=1) endif () set(JAVA_SDK_JNI_CMAKE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cmake" CACHE PATH "The cmake path for the library") diff --git a/test/testTransaction.cpp b/test/testTransaction.cpp index 45a553608..a23ee3070 100644 --- a/test/testTransaction.cpp +++ b/test/testTransaction.cpp @@ -26,6 +26,7 @@ #include #include #include +#include using namespace bcos; @@ -34,7 +35,15 @@ struct TestTxFixture }; BOOST_FIXTURE_TEST_SUITE(TransactionTest, TestTxFixture) +#if defined(BOOST_UUID_RANDOM_PROVIDER_SHOW) +#define PRINT_MACRO_HELPER(x) #x +#define PRINT_MACRO(x) #x"=" PRINT_MACRO_HELPER(x) +#pragma message(PRINT_MACRO(BOOST_UUID_RANDOM_PROVIDER_NAME)) +#endif +#if defined(BOOST_UUID_RANDOM_PROVIDER_POSIX) +#pragma message(PRINT_MACRO(BOOST_UUID_RANDOM_PROVIDER_POSIX)) +#endif const char* g_hw_abi = "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[]," "\"name\":\"get\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}]" diff --git a/vcpkg-configuration.json b/vcpkg-configuration.json index 446f88340..799132798 100644 --- a/vcpkg-configuration.json +++ b/vcpkg-configuration.json @@ -3,13 +3,14 @@ { "kind": "git", "repository": "https://github.com/FISCO-BCOS/registry", - "baseline": "c15466a352b8daede8d2c447670a761ad736c132", + "baseline": "ffebe39f161b78791148924f18ed0c9d4d4bce71", "packages": [ "openssl", "hsm-crypto", "fisco-bcos-cpp-sdk", "wedprcrypto", - "secp256k1" + "secp256k1", + "boost-uuid" ] } ]