Skip to content

Commit

Permalink
ci: Fix cross_compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
Mizux committed Jul 4, 2024
1 parent 042c7a3 commit 75a7515
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ message(STATUS "${PROJECT_NAME} version: ${PROJECT_VERSION}")
#message(STATUS "minor: ${PROJECT_VERSION_MINOR}")
#message(STATUS "patch: ${PROJECT_VERSION_PATCH}")

message(STATUS "system name: ${CMAKE_SYSTEM_NAME}")
get_property(isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if(isMultiConfig)
if(NOT CMAKE_CONFIGURATION_TYPES)
Expand Down
14 changes: 7 additions & 7 deletions ci/docker/toolchain/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,24 @@ FROM ubuntu:latest AS env
ENV PATH=/usr/local/bin:$PATH
RUN apt-get update -qq \
&& DEBIAN_FRONTEND=noninteractive apt-get install -yq git wget libssl-dev build-essential \
ninja-build python3 pkgconf libglib2.0-dev \
ninja-build python3 python3-venv pkgconf libglib2.0-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
ENTRYPOINT ["/usr/bin/bash", "-c"]
CMD ["/usr/bin/bash"]

# Install CMake 3.25.2
RUN wget "https://cmake.org/files/v3.25/cmake-3.25.2-linux-x86_64.sh" \
&& chmod a+x cmake-3.25.2-linux-x86_64.sh \
&& ./cmake-3.25.2-linux-x86_64.sh --prefix=/usr/local/ --skip-license \
&& rm cmake-3.25.2-linux-x86_64.sh
# Install CMake 3.28.3
RUN wget "https://cmake.org/files/v3.28/cmake-3.28.3-linux-x86_64.sh" \
&& chmod a+x cmake-3.28.3-linux-x86_64.sh \
&& ./cmake-3.28.3-linux-x86_64.sh --prefix=/usr/local/ --skip-license \
&& rm cmake-3.28.3-linux-x86_64.sh

FROM env AS devel
WORKDIR /home/project
COPY . .

ARG TARGET
ENV TARGET ${TARGET:-unknown}
ENV TARGET=${TARGET:-unknown}

FROM devel AS build
RUN cmake --version
Expand Down
10 changes: 5 additions & 5 deletions tools/cross_compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function install_qemu() {
>&2 echo 'QEMU is disabled !'
return 0
fi
local -r QEMU_VERSION=${QEMU_VERSION:=8.0.0}
local -r QEMU_VERSION=${QEMU_VERSION:=9.0.1}
local -r QEMU_TARGET=${QEMU_ARCH}-linux-user

if echo "${QEMU_VERSION} ${QEMU_TARGET}" | cmp --silent "${QEMU_INSTALL}/.build" -; then
Expand Down Expand Up @@ -224,7 +224,7 @@ function expand_codescape_config() {
local -r FLAVOUR="mips-r2-hard"
local -r LIBC_DIR_SUFFIX="lib"
;;
"mipsle" | "mips32el-r6")
"mipsel" | "mips32el-r6")
local -r MIPS_FLAGS="-EL -mips32r6 -mabi=32"
local -r FLAVOUR="mipsel-r6-hard"
local -r LIBC_DIR_SUFFIX="lib"
Expand All @@ -244,7 +244,7 @@ function expand_codescape_config() {
local -r FLAVOUR="mips-r2-hard"
local -r LIBC_DIR_SUFFIX="lib64"
;;
"mips64le" | "mips64el-r6")
"mips64el" | "mips64el-r6")
local -r MIPS_FLAGS="-EL -mips64r6 -mabi=64"
local -r FLAVOUR="mipsel-r6-hard"
local -r LIBC_DIR_SUFFIX="lib64"
Expand Down Expand Up @@ -456,13 +456,13 @@ function main() {
mips | mips32-r6 | mips32-r2)
expand_codescape_config
declare -r QEMU_ARCH=mips ;;
mipsle | mips32el-r6 | mips32el-r2)
mipsel | mips32el-r6 | mips32el-r2)
expand_codescape_config
declare -r QEMU_ARCH=mipsel ;;
mips64 | mips64-r6 | mips64-r2)
expand_codescape_config
declare -r QEMU_ARCH=mips64 ;;
mips64le | mips64el-r6 | mips64el-r2)
mips64el | mips64el-r6 | mips64el-r2)
expand_codescape_config
declare -r QEMU_ARCH=mips64el ;;
ppc64le | ppc64le-power8)
Expand Down

0 comments on commit 75a7515

Please sign in to comment.