Skip to content

Commit

Permalink
update cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
cyjseagull committed Oct 23, 2024
1 parent 3a09a05 commit 68b4957
Show file tree
Hide file tree
Showing 22 changed files with 23 additions and 62 deletions.
40 changes: 23 additions & 17 deletions .github/workflows/cpp_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down Expand Up @@ -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') }}
Expand All @@ -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
Expand All @@ -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: |
Expand Down
1 change: 0 additions & 1 deletion cpp/wedpr-computing/ppc-mpc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
project(ppc-mpc VERSION ${VERSION})
add_subdirectory(src)

#if (TESTS)
Expand Down
1 change: 0 additions & 1 deletion cpp/wedpr-computing/ppc-pir/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
project(ppc-pir VERSION ${VERSION})
add_subdirectory(src)

if (TESTS)
Expand Down
1 change: 0 additions & 1 deletion cpp/wedpr-computing/ppc-psi/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
project(ppc-psi VERSION ${VERSION})
add_subdirectory(src/psi-framework)
add_subdirectory(src/labeled-psi)
add_subdirectory(src/ra2018-psi)
Expand Down
2 changes: 0 additions & 2 deletions cpp/wedpr-crypto/ppc-crypto-core/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
project(ppc-crypto-core VERSION ${VERSION})

add_subdirectory(src)
if (TESTS)
enable_testing()
Expand Down
2 changes: 0 additions & 2 deletions cpp/wedpr-crypto/ppc-crypto/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
project(ppc-crypto VERSION ${VERSION})

add_subdirectory(src)
if(DEMO)
add_subdirectory(demo)
Expand Down
2 changes: 0 additions & 2 deletions cpp/wedpr-crypto/ppc-homo/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
project(ppc-homo VERSION ${VERSION})

add_subdirectory(codec)
add_subdirectory(paillier)
add_subdirectory(fahe)
Expand Down
2 changes: 0 additions & 2 deletions cpp/wedpr-crypto/ppc-udf/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
project(ppc-udf VERSION ${VERSION})

# export windows dll symbol
if(WIN32)
message(STATUS "Compile on Windows")
Expand Down
2 changes: 0 additions & 2 deletions cpp/wedpr-crypto/sdk/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
project(wedpr-component-sdk VERSION ${VERSION})

# export windows dll symbol
if(WIN32)
message(STATUS "Compile on Windows")
Expand Down
2 changes: 0 additions & 2 deletions cpp/wedpr-helper/ppc-tools/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
project(ppc-tools VERSION ${VERSION})

aux_source_directory(src/cuckoo SRCS)
aux_source_directory(src/config SRCS)

Expand Down
2 changes: 0 additions & 2 deletions cpp/wedpr-main/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
4 changes: 0 additions & 4 deletions cpp/wedpr-main/gateway/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
cmake_minimum_required(VERSION 3.14)

project(wedpr-gateway)

include_directories(${CMAKE_SOURCE_DIR})


Expand Down
4 changes: 0 additions & 4 deletions cpp/wedpr-main/pro-node/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
cmake_minimum_required(VERSION 3.14)

project(pro-psi-node)

include_directories(${CMAKE_SOURCE_DIR})

aux_source_directory(./ SRC_LIST)
Expand Down
2 changes: 0 additions & 2 deletions cpp/wedpr-protocol/protobuf/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
project(ppc-protocol VERSION ${VERSION})

add_subdirectory(src)
if (TESTS)
enable_testing()
Expand Down
2 changes: 0 additions & 2 deletions cpp/wedpr-protocol/protocol/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
project(ppc-protobuf VERSION ${VERSION})

add_subdirectory(src)
if (TESTS)
enable_testing()
Expand Down
5 changes: 0 additions & 5 deletions cpp/wedpr-protocol/tars/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 0 additions & 2 deletions cpp/wedpr-storage/ppc-io/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
project(ppc-io VERSION ${VERSION})

add_subdirectory(src)
if (DEMO)
add_subdirectory(demo)
Expand Down
1 change: 0 additions & 1 deletion cpp/wedpr-storage/ppc-storage/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
project(ppc-storage VERSION ${VERSION})
add_subdirectory(src)

if (DEMO)
Expand Down
4 changes: 0 additions & 4 deletions cpp/wedpr-transport/ppc-gateway/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
1 change: 0 additions & 1 deletion cpp/wedpr-transport/ppc-http/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
project(ppc-http VERSION ${VERSION})
add_subdirectory(src)

if (DEMO)
Expand Down
1 change: 0 additions & 1 deletion cpp/wedpr-transport/ppc-rpc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
project(ppc-rpc VERSION ${VERSION})
add_subdirectory(src)

if (TESTS)
Expand Down
2 changes: 0 additions & 2 deletions cpp/wedpr-transport/sdk/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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})
Expand Down

0 comments on commit 68b4957

Please sign in to comment.