Files
rosetta/configure-build
Max Wash b631fca0fd toolchain: add a program for compiling ipc interface definitions
ifc can be used to compile .if files into self-contained header-only C
libraries, which can be used to send/receive messages that conform
to the described interface.
2026-02-26 19:44:32 +00:00

61 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
# vim: ft=bash
target_arch=$1
if [ ! -n "$target_arch" ]; then
echo "Usage: $0 <target arch>"
exit -1
fi
build_type=Debug
source_dir=$(realpath $(dirname "$0"))
toolchain_build_dir=$source_dir/build/toolchain
target_build_dir=$source_dir/build
sysroot_dir=$target_build_dir/sysroot
if [ ! -d "$source_dir/arch/$target_arch" ]; then
echo "FATAL: Specified target architecture $target_arch is not supported. See arch/ directory for a list of supported architectures."
exit -1
fi
rm -rf $toolchain_build_dir $target_build_dir
mkdir -p $toolchain_build_dir $target_build_dir
pushd $toolchain_build_dir > /dev/null
cmake \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DCMAKE_BUILD_TYPE=$build_type \
$source_dir/toolchain
case $CMAKE_GENERATOR in
Ninja)
ninja
;;
"Unix Makefiles")
make
;;
*)
make
;;
esac
popd
pushd $target_build_dir > /dev/null
cmake \
-DBUILD_TOOLS_DIR=$toolchain_build_dir/bin \
-DCMAKE_INSTALL_PREFIX=$sysroot_dir \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DTARGET_ARCH=$target_arch \
-DCMAKE_BUILD_TYPE=$build_type \
$source_dir \
-DCMAKE_MODULE_PATH=$source_dir/arch/$target_arch \
-DCMAKE_SYSTEM_NAME=Rosetta \
-DCMAKE_TOOLCHAIN_FILE=$source_dir/arch/$target_arch/Platform/Rosetta.cmake
popd > /dev/null