File tree 4 files changed +13
-4
lines changed 4 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ FROM almalinux:8
3
3
RUN yum install -y \
4
4
autoconf \
5
5
automake \
6
- cmake \
7
6
diffutils \
8
7
gcc-c++ \
9
8
glibc-devel \
Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
4
4
apt-get update && \
5
5
apt-get upgrade -y && \
6
6
apt-get install -y --no-install-recommends \
7
- cmake \
8
7
build-essential \
9
8
ca-certificates \
10
9
curl \
Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
4
4
apt-get update && \
5
5
apt-get upgrade -y && \
6
6
apt-get install -y --no-install-recommends \
7
- cmake \
8
7
build-essential \
9
8
ca-certificates \
10
9
curl \
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ set -evux -o pipefail
5
5
6
6
PROTOBUF_VERSION=22.5
7
7
ABSL_VERSION=20230125.4
8
+ CMAKE_VERSION=3.13.4
8
9
9
10
# ARCH is x86_64 bit unless otherwise specified.
10
11
ARCH=" ${ARCH:- x86_64} "
@@ -29,6 +30,16 @@ if [ -f ${INSTALL_DIR}/bin/protoc ]; then
29
30
echo " Not building protobuf. Already built"
30
31
# TODO(ejona): swap to `brew install --devel protobuf` once it is up-to-date
31
32
else
33
+ if [[ ! -d " cmake-${CMAKE_VERSION} " ]]; then
34
+ curl -Ls " https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION} /cmake-${CMAKE_VERSION} .tar.gz" | tar xz
35
+ fi
36
+ # the same source dir is used for 32 and 64 bit builds, so we need to clean stale data first
37
+ rm -rf " $DOWNLOAD_DIR /cmake-${CMAKE_VERSION} /bin"
38
+ cd " $DOWNLOAD_DIR /cmake-${CMAKE_VERSION} "
39
+ ./bootstrap
40
+ make
41
+ make install
42
+ ln -s /usr/local/bin/cmake /usr/bin/cmake
32
43
if [[ ! -d " protobuf-${PROTOBUF_VERSION} " ]]; then
33
44
curl -Ls " https://github.com/google/protobuf/releases/download/v${PROTOBUF_VERSION} /protobuf-${PROTOBUF_VERSION} .tar.gz" | tar xz
34
45
curl -Ls " https://github.com/abseil/abseil-cpp/archive/refs/tags/${ABSL_VERSION} .tar.gz" | tar xz
60
71
cmake .. \
61
72
-DCMAKE_CXX_STANDARD=14 -Dprotobuf_BUILD_TESTS=OFF -DBUILD_SHARED_LIBS=OFF \
62
73
-DCMAKE_INSTALL_PREFIX=" $INSTALL_DIR " -Dcrosscompile_ARCH=" $GCC_ARCH " \
63
- -DCMAKE_TOOLCHAIN_FILE=$BUILDSCRIPTS_DIR /toolchain.cmake
74
+ -DCMAKE_TOOLCHAIN_FILE=$BUILDSCRIPTS_DIR /toolchain.cmake \
75
+ -B.
64
76
fi
65
77
export CMAKE_BUILD_PARALLEL_LEVEL=" $NUM_CPU "
66
78
cmake --build .
You can’t perform that action at this time.
0 commit comments