Skip to content

Commit

Permalink
switch to cmake for protobuf and allow shared target to consume it
Browse files Browse the repository at this point in the history
  • Loading branch information
csxwin committed Aug 10, 2023
1 parent 1bd0a99 commit b6d4f10
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 4 deletions.
8 changes: 7 additions & 1 deletion tools/install-deps-cross-android.sh
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,13 @@ install_deps() {
cd protobuf-${VERSION_PROTOBUF}
if [ ! -f ${NATIVE_PREFIX}/bin/protoc ]; then
mkdir build_native && cd build_native
../configure --prefix=${NATIVE_PREFIX}
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_POSITION_INDEPENDENT_CODE=On \
-Dprotobuf_BUILD_TESTS=Off \
-DCMAKE_INSTALL_PREFIX=${NATIVE_PREFIX} \
..
make install -j`nproc`
cd ..
fi
Expand Down
8 changes: 7 additions & 1 deletion tools/install-deps-cross-arm64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,13 @@ if ! ${USE_CACHE} || [ ! -d /usr/local/aarch64-linux-gnu ] || [ ! -d ${NATIVE_PR
tar -zxf protobuf-cpp-${VERSION_PROTOBUF}.tar.gz
cd protobuf-${VERSION_PROTOBUF}
mkdir build && cd build
../configure --prefix=${NATIVE_PREFIX}
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_POSITION_INDEPENDENT_CODE=On \
-Dprotobuf_BUILD_TESTS=Off \
-DCMAKE_INSTALL_PREFIX=${NATIVE_PREFIX} \
..
make install -j`nproc`
cd ..
mkdir build_arm64 && cd build_arm64
Expand Down
8 changes: 7 additions & 1 deletion tools/install-deps-cross-armhf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,13 @@ if ! ${USE_CACHE} || [ ! -d /usr/local/arm-linux-gnueabihf ] || [ ! -d ${NATIVE_
tar -zxf protobuf-cpp-${VERSION_PROTOBUF}.tar.gz
cd protobuf-${VERSION_PROTOBUF}
mkdir build && cd build
../configure --prefix=${NATIVE_PREFIX}
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_POSITION_INDEPENDENT_CODE=On \
-Dprotobuf_BUILD_TESTS=Off \
-DCMAKE_INSTALL_PREFIX=${NATIVE_PREFIX} \
..
make install -j`nproc`
cd ..
mkdir build_armhf && cd build_armhf
Expand Down
8 changes: 7 additions & 1 deletion tools/install-deps-native.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,13 @@ if ${INSTALL_BUILD_TIME_DEPS} && ( ! ${USE_CACHE} || [ ! -d ${PREFIX} ] ); then
tar -zxf protobuf-cpp-${VERSION_PROTOBUF}.tar.gz
cd protobuf-${VERSION_PROTOBUF}
mkdir build && cd build
../configure --prefix=${PREFIX}
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_POSITION_INDEPENDENT_CODE=On \
-Dprotobuf_BUILD_TESTS=Off \
-DCMAKE_INSTALL_PREFIX=${PREFIX} \
..
make install -j`nproc`
cd ../..

Expand Down

0 comments on commit b6d4f10

Please sign in to comment.