From 68b49571bd263e6cd6a1da068004f9ab83316a13 Mon Sep 17 00:00:00 2001 From: cyjseagull Date: Wed, 23 Oct 2024 14:59:27 +0800 Subject: [PATCH] update cmake --- .github/workflows/cpp_workflow.yml | 40 +++++++++++-------- cpp/wedpr-computing/ppc-mpc/CMakeLists.txt | 1 - cpp/wedpr-computing/ppc-pir/CMakeLists.txt | 1 - cpp/wedpr-computing/ppc-psi/CMakeLists.txt | 1 - .../ppc-crypto-core/CMakeLists.txt | 2 - cpp/wedpr-crypto/ppc-crypto/CMakeLists.txt | 2 - cpp/wedpr-crypto/ppc-homo/CMakeLists.txt | 2 - cpp/wedpr-crypto/ppc-udf/CMakeLists.txt | 2 - cpp/wedpr-crypto/sdk/CMakeLists.txt | 2 - cpp/wedpr-helper/ppc-tools/CMakeLists.txt | 2 - cpp/wedpr-main/CMakeLists.txt | 2 - cpp/wedpr-main/gateway/CMakeLists.txt | 4 -- cpp/wedpr-main/pro-node/CMakeLists.txt | 4 -- cpp/wedpr-protocol/protobuf/CMakeLists.txt | 2 - cpp/wedpr-protocol/protocol/CMakeLists.txt | 2 - cpp/wedpr-protocol/tars/CMakeLists.txt | 5 --- cpp/wedpr-storage/ppc-io/CMakeLists.txt | 2 - cpp/wedpr-storage/ppc-storage/CMakeLists.txt | 1 - .../ppc-gateway/CMakeLists.txt | 4 -- cpp/wedpr-transport/ppc-http/CMakeLists.txt | 1 - cpp/wedpr-transport/ppc-rpc/CMakeLists.txt | 1 - cpp/wedpr-transport/sdk/src/CMakeLists.txt | 2 - 22 files changed, 23 insertions(+), 62 deletions(-) diff --git a/.github/workflows/cpp_workflow.yml b/.github/workflows/cpp_workflow.yml index db66c38d..8f8d4bac 100644 --- a/.github/workflows/cpp_workflow.yml +++ b/.github/workflows/cpp_workflow.yml @@ -116,7 +116,9 @@ jobs: - name: Build for windows if: runner.os == 'Windows' run: | - mkdir -p cpp/build && cd cpp/build && cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_BUILD_TYPE=Release -DTESTS=OFF -DBUILD_SDK=ON -DVCPKG_TARGET_TRIPLET=x64-windows-static -DCMAKE_TOOLCHAIN_FILE=c:/vcpkg/scripts/buildsystems/vcpkg.cmake .. && MSBuild /version && MSBuild wedpr-component.sln /p:Configuration=Release /p:Platform=x64 + mkdir -p cpp/build && cd cpp/build && cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_BUILD_TYPE=Release -DTESTS=OFF -DBUILD_SDK=ON -DVCPKG_TARGET_TRIPLET=x64-windows-static -DCMAKE_TOOLCHAIN_FILE=c:/vcpkg/scripts/buildsystems/vcpkg.cmake .. + MSBuild /version + MSBuild wedpr-component.sln /p:Configuration=Release /p:Platform=x64 - name: Build for linux if: runner.os == 'Linux' run: | @@ -229,21 +231,22 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-20.04] - container: docker.io/centos:7 + os: [ubuntu-latest] + container: + image: docker.io/centos:7 + volumes: + - /usr/local/share/vcpkg:/usr/local/share/vcpkg steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 5 - - uses: actions/setup-node@v4 - with: - node-version: 16 - cache: 'npm' - - uses: actions/cache@v2 + - uses: actions/cache@v3 id: deps_cache with: path: | deps/ + /usr/local/share/vcpkg/buildtrees + /usr/local/share/vcpkg/packages /home/runner/.ccache /Users/runner/.ccache/ key: centos-notest-${{ matrix.os }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/workflow.yml') }} @@ -253,17 +256,20 @@ jobs: centos-notest-${{ matrix.os }}- - name: Prepare centos tools run: | - sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo + rpm -ivh https://cbs.centos.org/kojifiles/packages/centos-release-scl-rh/2/3.el7.centos/noarch/centos-release-scl-rh-2-3.el7.centos.noarch.rpm + rpm -ivh https://cbs.centos.org/kojifiles/packages/centos-release-scl/2/3.el7.centos/noarch/centos-release-scl-2-3.el7.centos.noarch.rpm + sed -i s/mirror.centos.org/mirrors.aliyun.com/g /etc/yum.repos.d/*.repo sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo - yum install -y java-11-openjdk-devel git make gcc gcc-c++ glibc-static glibc-devel openssl cmake3 ccache devtoolset-11 llvm-toolset-7.0 rh-perl530-perl libzstd-devel zlib-devel flex bison python-devel python3-devel - yum install -y devtoolset-10 devtoolset-11 llvm-toolset-7 rh-perl530-perl cmake3 zlib-devel ccache lcov python-devel python3-devel + cat /etc/yum.repos.d/*.repo + yum clean all + yum makecache + yum update -y + yum install -y epel-release centos-release-scl centos-release-scl-rh yum install -y https://packages.endpointdev.com/rhel/7/os/x86_64/endpoint-repo.x86_64.rpm + yum install -y java-11-openjdk-devel git make gcc gcc-c++ glibc-static glibc-devel openssl cmake3 ccache devtoolset-11 llvm-toolset-7.0 rh-perl530-perl libzstd-devel zlib-devel flex bison python-devel python3-devel + yum install -y rh-perl530-perl cmake3 zlib-devel ccache lcov python-devel python3-devel yum install -y git - - name: Prepare vcpkg - if: runner.os != 'Windows' - uses: friendlyanon/setup-vcpkg@v1 - with: { committish: 51b14cd4e1230dd51c11ffeff6f7d53c61cc5297 } - uses: actions-rs/toolchain@v1 with: toolchain: nightly-2022-07-28 @@ -278,7 +284,7 @@ jobs: . /opt/rh/llvm-toolset-7/enable mkdir -p cpp/build cd cpp/build - cmake3 -DCMAKE_BUILD_TYPE=Release -DTESTS=ON -DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake ../ + cmake3 -DCMAKE_BUILD_TYPE=Release -DTESTS=ON -DCMAKE_TOOLCHAIN_FILE=/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake ../ cmake3 --build . --parallel 3 - name: Test run: | diff --git a/cpp/wedpr-computing/ppc-mpc/CMakeLists.txt b/cpp/wedpr-computing/ppc-mpc/CMakeLists.txt index 53720a81..be4f918f 100644 --- a/cpp/wedpr-computing/ppc-mpc/CMakeLists.txt +++ b/cpp/wedpr-computing/ppc-mpc/CMakeLists.txt @@ -1,4 +1,3 @@ -project(ppc-mpc VERSION ${VERSION}) add_subdirectory(src) #if (TESTS) diff --git a/cpp/wedpr-computing/ppc-pir/CMakeLists.txt b/cpp/wedpr-computing/ppc-pir/CMakeLists.txt index bf3b53b3..0633d26f 100644 --- a/cpp/wedpr-computing/ppc-pir/CMakeLists.txt +++ b/cpp/wedpr-computing/ppc-pir/CMakeLists.txt @@ -1,4 +1,3 @@ -project(ppc-pir VERSION ${VERSION}) add_subdirectory(src) if (TESTS) diff --git a/cpp/wedpr-computing/ppc-psi/CMakeLists.txt b/cpp/wedpr-computing/ppc-psi/CMakeLists.txt index 06d0e477..8e5aa738 100644 --- a/cpp/wedpr-computing/ppc-psi/CMakeLists.txt +++ b/cpp/wedpr-computing/ppc-psi/CMakeLists.txt @@ -1,4 +1,3 @@ -project(ppc-psi VERSION ${VERSION}) add_subdirectory(src/psi-framework) add_subdirectory(src/labeled-psi) add_subdirectory(src/ra2018-psi) diff --git a/cpp/wedpr-crypto/ppc-crypto-core/CMakeLists.txt b/cpp/wedpr-crypto/ppc-crypto-core/CMakeLists.txt index 648242e1..2c156e1b 100644 --- a/cpp/wedpr-crypto/ppc-crypto-core/CMakeLists.txt +++ b/cpp/wedpr-crypto/ppc-crypto-core/CMakeLists.txt @@ -1,5 +1,3 @@ -project(ppc-crypto-core VERSION ${VERSION}) - add_subdirectory(src) if (TESTS) enable_testing() diff --git a/cpp/wedpr-crypto/ppc-crypto/CMakeLists.txt b/cpp/wedpr-crypto/ppc-crypto/CMakeLists.txt index c17b68b1..9f27bc5f 100644 --- a/cpp/wedpr-crypto/ppc-crypto/CMakeLists.txt +++ b/cpp/wedpr-crypto/ppc-crypto/CMakeLists.txt @@ -1,5 +1,3 @@ -project(ppc-crypto VERSION ${VERSION}) - add_subdirectory(src) if(DEMO) add_subdirectory(demo) diff --git a/cpp/wedpr-crypto/ppc-homo/CMakeLists.txt b/cpp/wedpr-crypto/ppc-homo/CMakeLists.txt index fda32930..06f891dc 100644 --- a/cpp/wedpr-crypto/ppc-homo/CMakeLists.txt +++ b/cpp/wedpr-crypto/ppc-homo/CMakeLists.txt @@ -1,5 +1,3 @@ -project(ppc-homo VERSION ${VERSION}) - add_subdirectory(codec) add_subdirectory(paillier) add_subdirectory(fahe) diff --git a/cpp/wedpr-crypto/ppc-udf/CMakeLists.txt b/cpp/wedpr-crypto/ppc-udf/CMakeLists.txt index e6fe5b4f..71e339b1 100644 --- a/cpp/wedpr-crypto/ppc-udf/CMakeLists.txt +++ b/cpp/wedpr-crypto/ppc-udf/CMakeLists.txt @@ -1,5 +1,3 @@ -project(ppc-udf VERSION ${VERSION}) - # export windows dll symbol if(WIN32) message(STATUS "Compile on Windows") diff --git a/cpp/wedpr-crypto/sdk/CMakeLists.txt b/cpp/wedpr-crypto/sdk/CMakeLists.txt index fae969e6..5fb633c2 100644 --- a/cpp/wedpr-crypto/sdk/CMakeLists.txt +++ b/cpp/wedpr-crypto/sdk/CMakeLists.txt @@ -1,5 +1,3 @@ -project(wedpr-component-sdk VERSION ${VERSION}) - # export windows dll symbol if(WIN32) message(STATUS "Compile on Windows") diff --git a/cpp/wedpr-helper/ppc-tools/CMakeLists.txt b/cpp/wedpr-helper/ppc-tools/CMakeLists.txt index aa4ae9b6..26cb4e2f 100644 --- a/cpp/wedpr-helper/ppc-tools/CMakeLists.txt +++ b/cpp/wedpr-helper/ppc-tools/CMakeLists.txt @@ -1,5 +1,3 @@ -project(ppc-tools VERSION ${VERSION}) - aux_source_directory(src/cuckoo SRCS) aux_source_directory(src/config SRCS) diff --git a/cpp/wedpr-main/CMakeLists.txt b/cpp/wedpr-main/CMakeLists.txt index 44e9a218..95d0d4b6 100644 --- a/cpp/wedpr-main/CMakeLists.txt +++ b/cpp/wedpr-main/CMakeLists.txt @@ -1,5 +1,3 @@ -project(ppc-main VERSION ${VERSION}) - set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) add_subdirectory(air-node) add_subdirectory(pro-node) diff --git a/cpp/wedpr-main/gateway/CMakeLists.txt b/cpp/wedpr-main/gateway/CMakeLists.txt index 062d9c66..08a62d76 100644 --- a/cpp/wedpr-main/gateway/CMakeLists.txt +++ b/cpp/wedpr-main/gateway/CMakeLists.txt @@ -1,7 +1,3 @@ -cmake_minimum_required(VERSION 3.14) - -project(wedpr-gateway) - include_directories(${CMAKE_SOURCE_DIR}) diff --git a/cpp/wedpr-main/pro-node/CMakeLists.txt b/cpp/wedpr-main/pro-node/CMakeLists.txt index 40664ebc..f83f6c10 100644 --- a/cpp/wedpr-main/pro-node/CMakeLists.txt +++ b/cpp/wedpr-main/pro-node/CMakeLists.txt @@ -1,7 +1,3 @@ -cmake_minimum_required(VERSION 3.14) - -project(pro-psi-node) - include_directories(${CMAKE_SOURCE_DIR}) aux_source_directory(./ SRC_LIST) diff --git a/cpp/wedpr-protocol/protobuf/CMakeLists.txt b/cpp/wedpr-protocol/protobuf/CMakeLists.txt index 615270ec..8ab6303d 100644 --- a/cpp/wedpr-protocol/protobuf/CMakeLists.txt +++ b/cpp/wedpr-protocol/protobuf/CMakeLists.txt @@ -1,5 +1,3 @@ -project(ppc-protocol VERSION ${VERSION}) - add_subdirectory(src) if (TESTS) enable_testing() diff --git a/cpp/wedpr-protocol/protocol/CMakeLists.txt b/cpp/wedpr-protocol/protocol/CMakeLists.txt index cda79d6d..8ab6303d 100644 --- a/cpp/wedpr-protocol/protocol/CMakeLists.txt +++ b/cpp/wedpr-protocol/protocol/CMakeLists.txt @@ -1,5 +1,3 @@ -project(ppc-protobuf VERSION ${VERSION}) - add_subdirectory(src) if (TESTS) enable_testing() diff --git a/cpp/wedpr-protocol/tars/CMakeLists.txt b/cpp/wedpr-protocol/tars/CMakeLists.txt index 7ae5a697..ebee8479 100644 --- a/cpp/wedpr-protocol/tars/CMakeLists.txt +++ b/cpp/wedpr-protocol/tars/CMakeLists.txt @@ -1,8 +1,3 @@ -cmake_minimum_required(VERSION 3.14) - -include(Version) -project(wedpr-tars-protocol VERSION ${VERSION}) - # for tars generator set(TARS_HEADER_DIR ${CMAKE_BINARY_DIR}/generated/tars) find_program(TARS_TARS2CPP tars2cpp REQUIRED) diff --git a/cpp/wedpr-storage/ppc-io/CMakeLists.txt b/cpp/wedpr-storage/ppc-io/CMakeLists.txt index 94d81491..f4ffe9dd 100644 --- a/cpp/wedpr-storage/ppc-io/CMakeLists.txt +++ b/cpp/wedpr-storage/ppc-io/CMakeLists.txt @@ -1,5 +1,3 @@ -project(ppc-io VERSION ${VERSION}) - add_subdirectory(src) if (DEMO) add_subdirectory(demo) diff --git a/cpp/wedpr-storage/ppc-storage/CMakeLists.txt b/cpp/wedpr-storage/ppc-storage/CMakeLists.txt index 36b28b6c..5e482dc1 100644 --- a/cpp/wedpr-storage/ppc-storage/CMakeLists.txt +++ b/cpp/wedpr-storage/ppc-storage/CMakeLists.txt @@ -1,4 +1,3 @@ -project(ppc-storage VERSION ${VERSION}) add_subdirectory(src) if (DEMO) diff --git a/cpp/wedpr-transport/ppc-gateway/CMakeLists.txt b/cpp/wedpr-transport/ppc-gateway/CMakeLists.txt index dc81e28d..142780b5 100644 --- a/cpp/wedpr-transport/ppc-gateway/CMakeLists.txt +++ b/cpp/wedpr-transport/ppc-gateway/CMakeLists.txt @@ -1,8 +1,4 @@ cmake_minimum_required(VERSION 3.14) - -include(Version) -project(ppc-gateway VERSION ${VERSION}) - find_package(Boost COMPONENTS filesystem) file(GLOB_RECURSE SRCS ppc-gateway/*.cpp) diff --git a/cpp/wedpr-transport/ppc-http/CMakeLists.txt b/cpp/wedpr-transport/ppc-http/CMakeLists.txt index 6039e2ed..5e482dc1 100644 --- a/cpp/wedpr-transport/ppc-http/CMakeLists.txt +++ b/cpp/wedpr-transport/ppc-http/CMakeLists.txt @@ -1,4 +1,3 @@ -project(ppc-http VERSION ${VERSION}) add_subdirectory(src) if (DEMO) diff --git a/cpp/wedpr-transport/ppc-rpc/CMakeLists.txt b/cpp/wedpr-transport/ppc-rpc/CMakeLists.txt index f111a675..6fa01414 100644 --- a/cpp/wedpr-transport/ppc-rpc/CMakeLists.txt +++ b/cpp/wedpr-transport/ppc-rpc/CMakeLists.txt @@ -1,4 +1,3 @@ -project(ppc-rpc VERSION ${VERSION}) add_subdirectory(src) if (TESTS) diff --git a/cpp/wedpr-transport/sdk/src/CMakeLists.txt b/cpp/wedpr-transport/sdk/src/CMakeLists.txt index 1231ca68..18e585fb 100644 --- a/cpp/wedpr-transport/sdk/src/CMakeLists.txt +++ b/cpp/wedpr-transport/sdk/src/CMakeLists.txt @@ -1,6 +1,4 @@ cmake_minimum_required(VERSION 3.14) -project(ppc-transport-sdk VERSION ${VERSION}) - file(GLOB_RECURSE SRCS *.cpp) add_library(${WEDPR_TRANSPORT_SDK_TARGET} ${SRCS})