Skip to content

Commit

Permalink
optimize compile
Browse files Browse the repository at this point in the history
  • Loading branch information
cyjseagull committed Oct 23, 2024
1 parent 6840af7 commit e244b38
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 23 deletions.
15 changes: 8 additions & 7 deletions cpp/cmake/CompilerSettings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,15 @@ elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC")
endif()

add_definitions(-DUSE_STD_RANGES)
add_compile_options(/std:c++latest)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++17")
add_compile_definitions(NOMINMAX)
add_compile_options(-bigobj)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")
# set(CMAKE_CXX_FLAGS_DEBUG "/MTd /DEBUG")
# set(CMAKE_CXX_FLAGS_MINSIZEREL "/MT /Os")
# set(CMAKE_CXX_FLAGS_RELEASE "/MT")
# set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MT /DEBUG")
link_libraries(ws2_32 Crypt32 userenv)
# MSVC only support static build
set(CMAKE_CXX_FLAGS_DEBUG "/MTd /DEBUG")
set(CMAKE_CXX_FLAGS_MINSIZEREL "/MT /Os")
set(CMAKE_CXX_FLAGS_RELEASE "/MT")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MT /DEBUG")
link_libraries(ws2_32 Crypt32 userenv)
else ()
message(WARNING "Your compiler is not tested, if you run into any issues, we'd welcome any patches.")
endif ()
Expand Down
3 changes: 3 additions & 0 deletions cpp/cmake/Options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,12 @@ macro(configure_project)
if (BUILD_UDF)
set(VISIBILITY_FLAG "")
set(BUILD_ALL OFF)
list(APPEND VCPKG_MANIFEST_FEATURES "sdk")
endif()
if (BUILD_SDK)
set(VISIBILITY_FLAG "")
set(BUILD_ALL OFF)
list(APPEND VCPKG_MANIFEST_FEATURES "sdk")
endif()
if (BUILD_WEDPR_TOOLKIT)
set(VISIBILITY_FLAG "")
Expand All @@ -138,6 +140,7 @@ macro(configure_project)
if (BUILD_ALL)
# install all dependencies
list(APPEND VCPKG_MANIFEST_FEATURES "all")
list(APPEND VCPKG_MANIFEST_FEATURES "sdk")
if(ENABLE_SSE)
# enable sse for libhdfs3
list(APPEND VCPKG_MANIFEST_FEATURES "sse-libhdfs3")
Expand Down
2 changes: 1 addition & 1 deletion cpp/vcpkg-configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"kind": "git",
"repository": "https://github.com/FISCO-BCOS/registry",
"baseline": "b483a0287c6ee7017983942af540e3ee672b0994",
"baseline": "d1aa5ece461d69d102e6a98ab222f684454bdb71",
"packages": [
"openssl",
"bcos-utilities",
Expand Down
34 changes: 19 additions & 15 deletions cpp/vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,6 @@
"name": "vcpkg-cmake-config",
"host": true
},
{
"name": "openssl",
"version>=": "1.1.1-tassl"
},
"libsodium",
{
"name": "libsodium",
"version>=": "1.0.18"
},
{
"name": "bcos-utilities",
"version>=": "1.0.0"
Expand Down Expand Up @@ -121,25 +112,38 @@
"name": "grpc",
"version>=": "1.51.1"
},
{
"name": "bcos-boostssl",
"version>=": "3.2.3"
},
"tarscpp",
"tbb",
"libxml2"
]
},
"toolkit": {
"description": "tooklit dependencies",
"sdk": {
"description": "sdk dependencies",
"dependencies": [
{
"name": "bcos-boostssl",
"version>=": "3.2.3"
"name": "openssl",
"version>=": "1.1.1-tassl"
},
"libsodium",
{
"name": "libsodium",
"version>=": "1.0.18"
}
]
},
"toolkit": {
"description": "tooklit dependencies",
"dependencies": [
{
"name": "grpc",
"version>=": "1.51.1"
},
"tarscpp",
"tbb",
"libxml2"
"tbb"
]
}
}
Expand Down

0 comments on commit e244b38

Please sign in to comment.