1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 08:47:34 +00:00

Build: Support non-i686 toolchains

* Add SERENITY_ARCH option to CMake for selecting the target toolchain
* Port all build scripts but continue to use i686
* Update GitHub Actions cache to include BuildIt.sh
This commit is contained in:
meme 2020-12-28 22:38:52 -05:00 committed by Andreas Kling
parent 8ca0e8325a
commit 23b23cee5a
12 changed files with 43 additions and 202 deletions

View file

@ -48,7 +48,7 @@ jobs:
# This assumes that *ALL* LibC headers have an impact on the Toolchain. # This assumes that *ALL* LibC headers have an impact on the Toolchain.
# This is wrong, and causes more Toolchain rebuilds than necessary. # This is wrong, and causes more Toolchain rebuilds than necessary.
# However, we want to avoid false cache hits at all costs. # However, we want to avoid false cache hits at all costs.
key: ${{ runner.os }}-toolchain-${{ hashFiles('Libraries/LibC/**/*.h', 'Toolchain/Patches/*.patch') }} key: ${{ runner.os }}-toolchain-i686-${{ hashFiles('Libraries/LibC/**/*.h', 'Toolchain/Patches/*.patch', 'Toolchain/BuildIt.sh') }}
- name: Restore or regenerate Toolchain - name: Restore or regenerate Toolchain
run: TRY_USE_LOCAL_TOOLCHAIN=y ${{ github.workspace }}/Toolchain/BuildIt.sh run: TRY_USE_LOCAL_TOOLCHAIN=y ${{ github.workspace }}/Toolchain/BuildIt.sh
@ -155,7 +155,7 @@ jobs:
# This assumes that *ALL* LibC headers have an impact on the Toolchain. # This assumes that *ALL* LibC headers have an impact on the Toolchain.
# This is wrong, and causes more Toolchain rebuilds than necessary. # This is wrong, and causes more Toolchain rebuilds than necessary.
# However, we want to avoid false cache hits at all costs. # However, we want to avoid false cache hits at all costs.
key: ${{ runner.os }}-toolchain-${{ hashFiles('Libraries/LibC/**/*.h', 'Toolchain/Patches/*.patch') }} key: ${{ runner.os }}-toolchain-i686-${{ hashFiles('Libraries/LibC/**/*.h', 'Toolchain/Patches/*.patch', 'Toolchain/BuildIt.sh') }}
- name: Restore or regenerate Toolchain - name: Restore or regenerate Toolchain
run: TRY_USE_LOCAL_TOOLCHAIN=y ${{ github.workspace }}/Toolchain/BuildIt.sh run: TRY_USE_LOCAL_TOOLCHAIN=y ${{ github.workspace }}/Toolchain/BuildIt.sh

View file

@ -14,6 +14,8 @@ enable_testing()
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(SERENITY_ARCH "i686" CACHE STRING "Target architecture for SerenityOS.")
add_custom_target(run add_custom_target(run
COMMAND ${CMAKE_SOURCE_DIR}/Meta/run.sh COMMAND ${CMAKE_SOURCE_DIR}/Meta/run.sh
USES_TERMINAL USES_TERMINAL
@ -23,12 +25,12 @@ add_custom_target(image
DEPENDS qemu-image DEPENDS qemu-image
) )
add_custom_target(qemu-image add_custom_target(qemu-image
COMMAND ${CMAKE_COMMAND} -E env "SERENITY_ROOT=${CMAKE_SOURCE_DIR}" ${CMAKE_SOURCE_DIR}/Meta/build-image-qemu.sh COMMAND ${CMAKE_COMMAND} -E env "SERENITY_ROOT=${CMAKE_SOURCE_DIR}" "SERENITY_ARCH=${SERENITY_ARCH}" ${CMAKE_SOURCE_DIR}/Meta/build-image-qemu.sh
BYPRODUCTS ${CMAKE_BINARY_DIR}/_disk_image BYPRODUCTS ${CMAKE_BINARY_DIR}/_disk_image
USES_TERMINAL USES_TERMINAL
) )
add_custom_target(grub-image add_custom_target(grub-image
COMMAND ${CMAKE_COMMAND} -E env "SERENITY_ROOT=${CMAKE_SOURCE_DIR}" ${CMAKE_SOURCE_DIR}/Meta/build-image-grub.sh COMMAND ${CMAKE_COMMAND} -E env "SERENITY_ROOT=${CMAKE_SOURCE_DIR}" "SERENITY_ARCH=${SERENITY_ARCH}" ${CMAKE_SOURCE_DIR}/Meta/build-image-grub.sh
BYPRODUCTS ${CMAKE_BINARY_DIR}/grub_disk_image BYPRODUCTS ${CMAKE_BINARY_DIR}/grub_disk_image
USES_TERMINAL USES_TERMINAL
) )
@ -79,8 +81,8 @@ set(CMAKE_STAGING_PREFIX ${CMAKE_BINARY_DIR}/Root)
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/Root) set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/Root)
set(CMAKE_INSTALL_DATAROOTDIR ${CMAKE_BINARY_DIR}/Root/res) set(CMAKE_INSTALL_DATAROOTDIR ${CMAKE_BINARY_DIR}/Root/res)
set(TOOLCHAIN_PATH ${CMAKE_SOURCE_DIR}/Toolchain/Local/bin) set(TOOLCHAIN_PATH ${CMAKE_SOURCE_DIR}/Toolchain/Local/${SERENITY_ARCH}/bin)
set(TOOLCHAIN_PREFIX ${TOOLCHAIN_PATH}/i686-pc-serenity-) set(TOOLCHAIN_PREFIX ${TOOLCHAIN_PATH}/${SERENITY_ARCH}-pc-serenity-)
set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}gcc) set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}gcc)
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}g++) set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}g++)

View file

@ -15,7 +15,7 @@ First, make sure you have a working toolchain and can build and run SerenityOS.
* Edit the `serenity.config` file (In Qt Creator, hit ^K or CMD+K on a Mac to open the search dialog, type the name of the file and hit return to open it) * Edit the `serenity.config` file (In Qt Creator, hit ^K or CMD+K on a Mac to open the search dialog, type the name of the file and hit return to open it)
* Add the following `#define`s to the file: `DEBUG`, `SANITIZE_PTRS`, and `KERNEL`. Depending on what you are working on, you need to have that last define commented out. If you're planning on working in the userland, comment out `#define KERNEL`. If you're working on the Kernel, then uncomment `#define KERNEL`. * Add the following `#define`s to the file: `DEBUG`, `SANITIZE_PTRS`, and `KERNEL`. Depending on what you are working on, you need to have that last define commented out. If you're planning on working in the userland, comment out `#define KERNEL`. If you're working on the Kernel, then uncomment `#define KERNEL`.
* Edit the `serenity.cxxflags` file to say `-std=c++2a -m32` * Edit the `serenity.cxxflags` file to say `-std=c++2a -m32`
* Edit the `serenity.includes` file, add the following lines: `.`, `..`, `../..`, `Services/`, `Libraries/`, `Libraries/LibC/`, `Libraries/LibPthread/`, `Libraries/LibM/`, `Toolchain/Local/i686-pc-serenity/include/c++/10.2.0`, `Build/Services/`, `Build/Libraries/`, `AK/` * Edit the `serenity.includes` file, add the following lines: `.`, `..`, `../..`, `Services/`, `Libraries/`, `Libraries/LibC/`, `Libraries/LibPthread/`, `Libraries/LibM/`, `Toolchain/Local/i686/i686-pc-serenity/include/c++/10.2.0`, `Build/Services/`, `Build/Libraries/`, `AK/`
Qt Creator should be set up correctly now, go ahead and explore the project and try making changes. Have fun! :^) Qt Creator should be set up correctly now, go ahead and explore the project and try making changes. Have fun! :^)
@ -42,4 +42,4 @@ You may want to read up what `git add -p` does (or `git checkout -p`, to undo).
## Compiler Kits ## Compiler Kits
You can slightly improve how well Qt interprets the code by adding and setting up an appropriate "compiler kit". You can slightly improve how well Qt interprets the code by adding and setting up an appropriate "compiler kit".
For that you will need to reference the compilers at `Toolchain/Local/bin/i686-pc-serenity-gcc` and `Toolchain/Local/bin/i686-pc-serenity-g++`. For that you will need to reference the compilers at `Toolchain/Local/i686/bin/i686-pc-serenity-gcc` and `Toolchain/Local/i686/bin/i686-pc-serenity-g++`.

View file

@ -274,10 +274,10 @@ file(GENERATE OUTPUT linker.ld INPUT linker.ld)
if (${CMAKE_HOST_SYSTEM_NAME} MATCHES SerenityOS) if (${CMAKE_HOST_SYSTEM_NAME} MATCHES SerenityOS)
include_directories(/usr/local/include/c++/10.2.0/) include_directories(/usr/local/include/c++/10.2.0/)
include_directories(/usr/local/include/c++/10.2.0/i686-pc-serenity/) include_directories(/usr/local/include/c++/10.2.0/${SERENITY_ARCH}-pc-serenity/)
else() else()
include_directories(../Toolchain/Local/i686-pc-serenity/include/c++/10.2.0/) include_directories(../Toolchain/Local/${SERENITY_ARCH}/${SERENITY_ARCH}-pc-serenity/include/c++/10.2.0/)
include_directories(../Toolchain/Local/i686-pc-serenity/include/c++/10.2.0/i686-pc-serenity/) include_directories(../Toolchain/Local/${SERENITY_ARCH}/${SERENITY_ARCH}-pc-serenity/include/c++/10.2.0/${SERENITY_ARCH}-pc-serenity/)
endif() endif()
add_executable(Kernel ${SOURCES}) add_executable(Kernel ${SOURCES})

View file

@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 3.0)
project(serenity) project(serenity)
set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD 20)
set(SERENITY_ARCH "i686" CACHE STRING "Target architecture for SerenityOS.")
file(GLOB_RECURSE AK_SOURCES "serenity/AK/*.cpp") file(GLOB_RECURSE AK_SOURCES "serenity/AK/*.cpp")
file(GLOB_RECURSE APPLICATIONS_SOURCES "serenity/Applications/*.cpp") file(GLOB_RECURSE APPLICATIONS_SOURCES "serenity/Applications/*.cpp")
file(GLOB_RECURSE BASE_SOURCES "serenity/Base/*.cpp") file(GLOB_RECURSE BASE_SOURCES "serenity/Base/*.cpp")
@ -26,7 +28,7 @@ set(INCLUDE_DIRS
"serenity/Libraries/LibPthread" "serenity/Libraries/LibPthread"
"serenity/Libraries/LibM" "serenity/Libraries/LibM"
"serenity/Services" "serenity/Services"
"serenity/Toolchain/Local/i686-pc-serenity/include/c++/10.2.0" "serenity/Toolchain/Local/${SERENITY_ARCH}/${SERENITY_ARCH}-pc-serenity/include/c++/10.2.0"
"serenity/Build/Services" "serenity/Build/Services"
"serenity/Build/Libraries") "serenity/Build/Libraries")

View file

@ -33,7 +33,7 @@ umask 0022
printf "installing base system... " printf "installing base system... "
$CP -PdR "$SERENITY_ROOT"/Base/* mnt/ $CP -PdR "$SERENITY_ROOT"/Base/* mnt/
$CP "$SERENITY_ROOT"/Toolchain/Local/i686-pc-serenity/lib/libgcc_s.so mnt/usr/lib/ $CP "$SERENITY_ROOT"/Toolchain/Local/i686/i686-pc-serenity/lib/libgcc_s.so mnt/usr/lib/
$CP -PdR Root/* mnt/ $CP -PdR Root/* mnt/
# If umask was 027 or similar when the repo was cloned, # If umask was 027 or similar when the repo was cloned,
# file permissions in Base/ are too restrictive. Restore # file permissions in Base/ are too restrictive. Restore

View file

@ -7,7 +7,7 @@ prefix=$SERENITY_ROOT/Ports
export CC=i686-pc-serenity-gcc export CC=i686-pc-serenity-gcc
export CXX=i686-pc-serenity-g++ export CXX=i686-pc-serenity-g++
export PATH=$SERENITY_ROOT/Toolchain/Local/bin:$PATH export PATH=$SERENITY_ROOT/Toolchain/Local/i686/bin:$PATH
MD5SUM=md5sum MD5SUM=md5sum

View file

@ -11,7 +11,7 @@ echo "$DIR"
ARCH=${ARCH:-"i686"} ARCH=${ARCH:-"i686"}
TARGET="$ARCH-pc-serenity" TARGET="$ARCH-pc-serenity"
PREFIX="$DIR/Local" PREFIX="$DIR/Local/$ARCH"
BUILD=$(realpath "$DIR/../Build") BUILD=$(realpath "$DIR/../Build")
SYSROOT="$BUILD/Root" SYSROOT="$BUILD/Root"
@ -179,14 +179,14 @@ popd
# === COMPILE AND INSTALL === # === COMPILE AND INSTALL ===
mkdir -p "$PREFIX" mkdir -p "$PREFIX"
mkdir -p "$DIR/Build/binutils" mkdir -p "$DIR/Build/$ARCH/binutils"
mkdir -p "$DIR/Build/gcc" mkdir -p "$DIR/Build/$ARCH/gcc"
if [ -z "$MAKEJOBS" ]; then if [ -z "$MAKEJOBS" ]; then
MAKEJOBS=$($NPROC) MAKEJOBS=$($NPROC)
fi fi
pushd "$DIR/Build/" pushd "$DIR/Build/$ARCH"
unset PKG_CONFIG_LIBDIR # Just in case unset PKG_CONFIG_LIBDIR # Just in case
pushd binutils pushd binutils
@ -251,7 +251,7 @@ pushd "$DIR/Build/"
"$MAKE" install-target-libstdc++-v3 || exit 1 "$MAKE" install-target-libstdc++-v3 || exit 1
if [ "$(uname -s)" = "OpenBSD" ]; then if [ "$(uname -s)" = "OpenBSD" ]; then
cd "$DIR/Local/libexec/gcc/i686-pc-serenity/$GCC_VERSION" && ln -sf liblto_plugin.so.0.0 liblto_plugin.so cd "$DIR/Local/libexec/gcc/$TARGET/$GCC_VERSION" && ln -sf liblto_plugin.so.0.0 liblto_plugin.so
fi fi
popd popd

View file

@ -1,171 +0,0 @@
#!/usr/bin/env bash
set -e
# This file will need to be run in bash, for now.
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
echo "$DIR"
ARCH=${ARCH:-"x86_64"}
TARGET="$ARCH-pc-serenity"
PREFIX="$DIR/Local/x86_64"
SYSROOT="$DIR/../Root"
MAKE="make"
MD5SUM="md5sum"
NPROC="nproc"
if [ "$(uname -s)" = "OpenBSD" ]; then
MAKE=gmake
MD5SUM="md5 -q"
NPROC="sysctl -n hw.ncpuonline"
export CC=egcc
export CXX=eg++
export with_gmp=/usr/local
export LDFLAGS=-Wl,-z,notext
elif [ "$(uname -s)" = "FreeBSD" ]; then
MAKE=gmake
MD5SUM="md5 -q"
NPROC="sysctl -n hw.ncpu"
export with_gmp=/usr/local
export with_mpfr=/usr/local
fi
echo PREFIX is "$PREFIX"
echo SYSROOT is "$SYSROOT"
mkdir -p "$DIR/Tarballs"
BINUTILS_VERSION="2.33.1"
BINUTILS_MD5SUM="1a6b16bcc926e312633fcc3fae14ba0a"
BINUTILS_NAME="binutils-$BINUTILS_VERSION"
BINUTILS_PKG="${BINUTILS_NAME}.tar.gz"
BINUTILS_BASE_URL="http://ftp.gnu.org/gnu/binutils"
GCC_VERSION="10.1.0"
GCC_MD5SUM="8a9fbd7e24d04c5d36e96bc894d3cd6b"
GCC_NAME="gcc-$GCC_VERSION"
GCC_PKG="${GCC_NAME}.tar.gz"
GCC_BASE_URL="http://ftp.gnu.org/gnu/gcc"
pushd "$DIR/Tarballs"
md5="$($MD5SUM $BINUTILS_PKG | cut -f1 -d' ')"
echo "bu md5='$md5'"
if [ ! -e $BINUTILS_PKG ] || [ "$md5" != ${BINUTILS_MD5SUM} ] ; then
rm -f $BINUTILS_PKG
curl -LO "$BINUTILS_BASE_URL/$BINUTILS_PKG"
else
echo "Skipped downloading binutils"
fi
md5="$($MD5SUM ${GCC_PKG} | cut -f1 -d' ')"
echo "gc md5='$md5'"
if [ ! -e $GCC_PKG ] || [ "$md5" != ${GCC_MD5SUM} ] ; then
rm -f $GCC_PKG
curl -LO "$GCC_BASE_URL/$GCC_NAME/$GCC_PKG"
else
echo "Skipped downloading gcc"
fi
if [ ! -d ${BINUTILS_NAME} ]; then
echo "Extracting binutils..."
tar -xzf ${BINUTILS_PKG}
pushd ${BINUTILS_NAME}
git init >/dev/null
git add . >/dev/null
git commit -am "BASE" >/dev/null
git apply "$DIR"/Patches/binutils.patch >/dev/null
popd
else
echo "Skipped extracting binutils"
fi
if [ ! -d $GCC_NAME ]; then
echo "Extracting gcc..."
tar -xzf $GCC_PKG
pushd $GCC_NAME
git init >/dev/null
git add . >/dev/null
git commit -am "BASE" >/dev/null
git apply "$DIR"/Patches/gcc.patch >/dev/null
popd
else
echo "Skipped extracting gcc"
fi
if [ "$(uname)" = "Darwin" ]; then
pushd "gcc-${GCC_VERSION}"
./contrib/download_prerequisites
popd
fi
popd
mkdir -p "$PREFIX"
mkdir -p "$DIR/Build/x86_64/binutils"
mkdir -p "$DIR/Build/x86_64/gcc"
if [ -z "$MAKEJOBS" ]; then
MAKEJOBS=$($NPROC)
fi
pushd "$DIR/Build/x86_64"
unset PKG_CONFIG_LIBDIR # Just in case
pushd binutils
rm -f ./config.cache # Let's do this in case someone has already built the i686 version
"$DIR"/Tarballs/binutils-2.33.1/configure --prefix="$PREFIX" \
--target="$TARGET" \
--with-sysroot="$SYSROOT" \
--enable-shared \
--disable-nls || exit 1
if [ "$(uname)" = "Darwin" ]; then
# under macOS generated makefiles are not resolving the "intl"
# dependency properly to allow linking its own copy of
# libintl when building with --enable-shared.
"$MAKE" -j "$MAKEJOBS" || true
pushd intl
"$MAKE" all-yes
popd
fi
"$MAKE" -j "$MAKEJOBS" || exit 1
"$MAKE" install || exit 1
popd
pushd gcc
if [ "$(uname -s)" = "OpenBSD" ]; then
perl -pi -e 's/-no-pie/-nopie/g' "$DIR/Tarballs/gcc-$GCC_VERSION/gcc/configure"
fi
"$DIR/Tarballs/gcc-$GCC_VERSION/configure" --prefix="$PREFIX" \
--target="$TARGET" \
--with-sysroot="$SYSROOT" \
--disable-nls \
--with-newlib \
--enable-shared \
--enable-languages=c,c++ || exit 1
echo "XXX build gcc and libgcc"
"$MAKE" -j "$MAKEJOBS" all-gcc all-target-libgcc || exit 1
echo "XXX install gcc and libgcc"
"$MAKE" install-gcc install-target-libgcc || exit 1
echo "XXX serenity libc and libm"
( cd "$DIR/../Libraries/LibC/" && "$MAKE" clean && "$MAKE" EXTRA_LIBC_DEFINES="-DBUILDING_SERENITY_TOOLCHAIN" && "$MAKE" install )
( cd "$DIR/../Libraries/LibM/" && "$MAKE" clean && "$MAKE" && "$MAKE" install )
echo "XXX build libstdc++"
"$MAKE" all-target-libstdc++-v3 || exit 1
echo "XXX install libstdc++"
"$MAKE" install-target-libstdc++-v3 || exit 1
if [ "$(uname -s)" = "OpenBSD" ]; then
cd "$DIR/Local/libexec/gcc/x86_64-pc-serenity/$GCC_VERSION" && ln -sf liblto_plugin.so.0.0 liblto_plugin.so
fi
popd
popd

View file

@ -7,9 +7,11 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
echo "$DIR" echo "$DIR"
TARGET=i686-pc-serenity ARCH=${ARCH:-"i686"}
PREFIX="$DIR/Local" TARGET="$ARCH-pc-serenity"
SYSROOT="$DIR/../Root" PREFIX="$DIR/Local/$ARCH"
BUILD=$(realpath "$DIR/../Build")
SYSROOT="$BUILD/Root"
source "$DIR/../Ports/python-3.6/version.sh" source "$DIR/../Ports/python-3.6/version.sh"
@ -45,13 +47,13 @@ pushd "$DIR/Tarballs"
popd popd
mkdir -p "$PREFIX" mkdir -p "$PREFIX"
mkdir -p "$DIR/Build/python" mkdir -p "$DIR/Build/$ARCH/python"
if [ -z "$MAKEJOBS" ]; then if [ -z "$MAKEJOBS" ]; then
MAKEJOBS=$(nproc) MAKEJOBS=$(nproc)
fi fi
pushd "$DIR/Build/" pushd "$DIR/Build/$ARCH"
pushd python pushd python
"$DIR"/Tarballs/Python-$PYTHON_VERSION/configure --prefix="$PREFIX" || exit 1 "$DIR"/Tarballs/Python-$PYTHON_VERSION/configure --prefix="$PREFIX" || exit 1
make -j "$MAKEJOBS" || exit 1 make -j "$MAKEJOBS" || exit 1

View file

@ -7,9 +7,11 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
echo "$DIR" echo "$DIR"
TARGET=i686-pc-serenity ARCH=${ARCH:-"i686"}
PREFIX="$DIR/Local" TARGET="$ARCH-pc-serenity"
SYSROOT="$DIR/../Root" PREFIX="$DIR/Local/$ARCH"
BUILD=$(realpath "$DIR/../Build")
SYSROOT="$BUILD/Root"
QEMU300_MD5SUM="6a5c8df583406ea24ef25b239c3243e0" QEMU300_MD5SUM="6a5c8df583406ea24ef25b239c3243e0"
QEMU410_MD5SUM="cdf2b5ca52b9abac9bacb5842fa420f8" QEMU410_MD5SUM="cdf2b5ca52b9abac9bacb5842fa420f8"
@ -46,7 +48,7 @@ pushd "$DIR/Tarballs"
popd popd
mkdir -p "$PREFIX" mkdir -p "$PREFIX"
mkdir -p "$DIR/Build/qemu" mkdir -p "$DIR/Build/$ARCH/qemu"
if [ -z "$MAKEJOBS" ]; then if [ -z "$MAKEJOBS" ]; then
MAKEJOBS=$(nproc) MAKEJOBS=$(nproc)
@ -61,7 +63,7 @@ fi
echo Using $UI_LIB based UI echo Using $UI_LIB based UI
pushd "$DIR/Build/" pushd "$DIR/Build/$ARCH"
pushd qemu pushd qemu
"$DIR"/Tarballs/$QEMU_VERSION/configure --prefix="$PREFIX" \ "$DIR"/Tarballs/$QEMU_VERSION/configure --prefix="$PREFIX" \
--target-list=i386-softmmu \ --target-list=i386-softmmu \

View file

@ -1,5 +1,9 @@
set(CMAKE_SYSTEM_NAME Generic) set(CMAKE_SYSTEM_NAME Generic)
if (NOT DEFINED ENV{SERENITY_ARCH})
message(FATAL_ERROR "SERENITY_ARCH not set.")
endif()
if (NOT DEFINED ENV{SERENITY_ROOT}) if (NOT DEFINED ENV{SERENITY_ROOT})
message(FATAL_ERROR "SERENITY_ROOT not set.") message(FATAL_ERROR "SERENITY_ROOT not set.")
endif() endif()
@ -12,8 +16,8 @@ set(CMAKE_STAGING_PREFIX $ENV{SERENITY_ROOT}/Build/Root/usr)
set(CMAKE_INSTALL_PREFIX $ENV{SERENITY_ROOT}/Build/Root/usr) set(CMAKE_INSTALL_PREFIX $ENV{SERENITY_ROOT}/Build/Root/usr)
set(CMAKE_INSTALL_DATAROOTDIR $ENV{SERENITY_ROOT}/Build/Root/usr/share) set(CMAKE_INSTALL_DATAROOTDIR $ENV{SERENITY_ROOT}/Build/Root/usr/share)
set(CMAKE_C_COMPILER i686-pc-serenity-gcc) set(CMAKE_C_COMPILER ENV{SERENITY_ARCH}-pc-serenity-gcc)
set(CMAKE_CXX_COMPILER i686-pc-serenity-g++) set(CMAKE_CXX_COMPILER ENV{SERENITY_ARCH}-pc-serenity-g++)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)