Skip to content

Commit

Permalink
Fixed absl for GH actions
Browse files Browse the repository at this point in the history
  • Loading branch information
EduMenges committed Jul 11, 2024
1 parent c353951 commit 41191a1
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 18 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/test-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,17 @@ jobs:
- name: Add Rust target
run: rustup target add wasm32-unknown-emscripten

- name: Configure CMake for Mac x86
if: ${{ matrix.target == 'OSX'}}
run: cmake -S build/${{matrix.target}} -B build/${{matrix.target}}/${{matrix.build_type}} -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DPLATFORM=MAC

- name: Configure CMake for iOS
if: ${{ matrix.target == 'iOS'}}
run: cmake -S build/${{matrix.target}} -B build/${{matrix.target}}/${{matrix.build_type}} -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DPLATFORM=OS64

- name: Configure CMake
if: ${{ matrix.target != 'OSX' && matrix.target != 'iOS' }}
run: cmake -S build/${{matrix.target}} -B build/${{matrix.target}}/${{matrix.build_type}} -DCMAKE_BUILD_TYPE=${{matrix.build_type}}

- name: Build project
run: cmake --build build/${{matrix.target}}/${{matrix.build_type}} --config ${{matrix.build_type}} -j
run: cmake --build build/${{matrix.target}}/${{matrix.build_type}} --config ${{matrix.build_type}} -j --target protobuf-plugin
13 changes: 3 additions & 10 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
[submodule "boost"]
path = boost
url = https://github.com/boostorg/boost.git
branch = boost-1.80.0
branch = boost-1.85.0
ignore = dirty
[submodule "libp2p"]
path = libp2p
url = ../libp2p.git
branch = master
[submodule "ipfs-lite-cpp"]
path = ipfs-lite-cpp
url = ../ipfs-lite-cpp.git
branch = master
[submodule "restclient-cpp"]
path = restclient-cpp
url = https://github.com/mrtazz/restclient-cpp.git
Expand Down Expand Up @@ -54,14 +53,12 @@
[submodule "ipfs-pubsub"]
path = ipfs-pubsub
url = ../ipfs-pubsub.git
branch = master
[submodule "GTest"]
path = GTest
url = https://github.com/google/googletest
[submodule "ed25519"]
path = ed25519
url = https://github.com/hyperledger/iroha-ed25519.git
branch = master
[submodule "rapidjson"]
path = rapidjson
url = https://github.com/Tencent/rapidjson
Expand All @@ -78,14 +75,12 @@
[submodule "delta-enabled-crdts"]
path = delta-enabled-crdts
url = ../delta-enabled-crdts.git
branch = master
[submodule "rocksdb"]
path = rocksdb
url = ../rocksdb.git
[submodule "sr25519-donna"]
path = sr25519-donna
url = ../sr25519-donna.git
branch = master
[submodule "fmt"]
path = fmt
url = https://github.com/fmtlib/fmt.git
Expand All @@ -105,11 +100,9 @@
[submodule "ipfs-bitswap-cpp"]
path = ipfs-bitswap-cpp
url = ../ipfs-bitswap-cpp.git
branch = master
[submodule "openssl"]
path = openssl
url = https://github.com/openssl/openssl.git
branch = OpenSSL_1_1_1-stable
[submodule "libsecp256k1"]
path = libsecp256k1
url = ../secp256k1
Expand All @@ -131,6 +124,7 @@
[submodule "wallet-core"]
path = wallet-core
url = ../wallet-core.git
ignore = dirty
[submodule "MNN"]
path = MNN
url = ../MNN.git
Expand All @@ -144,7 +138,6 @@
[submodule "AsyncIOManager"]
path = AsyncIOManager
url = ../AsyncIOManager.git
branch = refactor_async_mnnloader
[submodule "cryptopp-cmake"]
path = cryptopp-cmake
url = https://github.com/abdes/cryptopp-cmake.git
Expand Down
1 change: 0 additions & 1 deletion build/CommonTargets.CMake
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,6 @@ ExternalProject_Add(protobuf-plugin
CMAKE_CACHE_ARGS
-DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
-Dabsl_DIR:PATH=${absl_HOST_DIR}
-DCMAKE_OSX_ARCHITECTURES:STRING=${CMAKE_HOST_SYSTEM_PROCESSOR}
-DProtobuf_DIR:PATH=${Protobuf_HOST_DIR}
-Dprotobuf_MODULE_COMPATIBLE:BOOL=ON
-DTW_USE_EXTERNAL_PROTOC:BOOL=TRUE
Expand Down
6 changes: 1 addition & 5 deletions build/OSX/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
cmake_minimum_required(VERSION 3.22)

if(NOT ${CMAKE_HOST_SYSTEM_NAME} MATCHES "Darwin")
message(FATAL_ERROR "${CMAKE_HOST_SYSTEM_NAME} host system name does not match OSX Darwin - Please select the correct folder for configuring project")
endif()

if(POLICY CMP0025)
cmake_policy(SET CMP0025 NEW)
endif()
Expand All @@ -15,7 +11,7 @@ endif()
if(NOT DEFINED CMAKE_TOOLCHAIN_FILE)
cmake_host_system_information(RESULT HOST_SYSTEM_PROCESSOR QUERY OS_PLATFORM)

if(HOST_SYSTEM_PROCESSOR STREQUAL "arm")
if(HOST_SYSTEM_PROCESSOR MATCHES "arm")
set(_PLATFORM "MAC_ARM64")
else()
set(_PLATFORM "MAC")
Expand Down
4 changes: 4 additions & 0 deletions build/apple.toolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -875,6 +875,10 @@ else()
set(CMAKE_SYSTEM_PROCESSOR "arm")
endif()

if(NOT ${CMAKE_SYSTEM_PROCESSOR} STREQUAL ${CMAKE_HOST_SYSTEM_PROCESSOR})
set(CMAKE_CROSSCOMPILING ON)
endif()

# Note that only Xcode 7+ supports the newer more specific:
# -m${SDK_NAME}-version-min flags, older versions of Xcode use:
# -m(ios/ios-simulator)-version-min instead.
Expand Down
50 changes: 50 additions & 0 deletions build/foo.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/bin/bash
cd Linux/Foo/CMakeFiles
declare -A cMakeBuildDir
while IFS=',' read -r cmakeName buildDir; do
cMakeBuildDir["$cmakeName"]="$buildDir"
done < <(grep -m1 -R --include "build.make" -e ".*-complete:.*-build" * |
sed -E -n 's/^(.*)\.dir.*-complete: ([^/]*?)\/src.*/\1,\2/p')

cd ..
declare -A cMakeNamesRepos
for key in "${!cMakeBuildDir[@]}"; do
sourceDir=$(find . -type f -name "${key}-source_dirinfo.txt" -exec sed -n 's/^source_dir=\(.*\)\/\(.*\)/\2/p' {} \;)
cMakeNamesRepos["$key"]=$sourceDir
done

declare -A gitLibModules
cd ../../..
while IFS=',' read -r longSHA sourceDir; do
gitLibModules["$sourceDir"]="$longSHA"
done < <(git ls-tree HEAD |
sed -E -n 's/^(160000 commit|040000 tree) ([a-f0-9]+)[ \t]+([^ ]+)$/\2,\3/p')

# Initialize the variables
cMakeNames=""
buildDirectoryNames=""
repoNames=""
shortSHAs=""

# Define column widths
name_width=20
build_dir_width=20
source_dir_width=20

# Print header
printf "%-${name_width}s | %-${build_dir_width}s | %-${source_dir_width}s | %-${sha_width}s\n" "Name" "Build dir" "Source dir" "SHA"
for key in "${!cMakeBuildDir[@]}"; do
buildDir="${cMakeBuildDir[$key]}"
sourceDir="${cMakeNamesRepos[$key]}"
shortSHA="${gitLibModules[$sourceDir]:0:7}"
cMakeNames+="${key}\n"
buildDirectoryNames+="${buildDir}\n"
repoNames+="${sourceDir}\n"
shortSHAs+="${shortSHA}\n"
printf "%-${name_width}s | %-${build_dir_width}s | %-${source_dir_width}s | %s\n" "${key}" "${buildDir}" "${sourceDir}" "${shortSHA}"
done

echo "TARGET_NAMES\n$cMakeNames"
echo "TARGET_SHAS\n$shortSHAs"
echo "TARGET_DIRECTORIES\n$buildDirectoryNames"
echo "TARGET_REPO_NAMES\n$repoNames"
2 changes: 1 addition & 1 deletion grpc
Submodule grpc updated 1 files
+1 −1 third_party/abseil-cpp

0 comments on commit 41191a1

Please sign in to comment.