mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-06 12:00:17 +02:00
The cmake_enable_libfwd.sh script will automatically install any required cross- toolchains and development headers required to enable library forwarding, and it will reconfigure the current build folder appropriately. For advanced uses, a shell can be opened by running `nix-shell LibraryForwarding/shell.nix`, which will make the toolchain available via environment variables.
23 lines
740 B
Bash
Executable File
23 lines
740 B
Bash
Executable File
# Helper script to configure CMake for library forwarding in FEX.
|
|
# Nix is used to install and manage the required cross-toolchains.
|
|
|
|
if [ ! -f CMakeCache.txt ]
|
|
then
|
|
echo "Must be run from a pre-configured CMake build folder"
|
|
exit 1
|
|
fi
|
|
|
|
# Remove previous build to ensure the new toolchain is applied
|
|
rm -rf guest-libs guest-libs-32 Guest Guest_32
|
|
|
|
# Set clang executable path manually since the one from the nix store
|
|
# will be picked up otherwise
|
|
CLANG_EXEC_PATH=""
|
|
if ! grep -q CLANG_EXEC_PATH CMakeCache.txt
|
|
then
|
|
CLANG_EXEC_PATH="-DCLANG_EXEC_PATH=`which clang`"
|
|
fi
|
|
|
|
nix-shell `dirname -- "$0"`/LibraryForwarding/shell.nix \
|
|
--run "set -o xtrace; cmake . \$FEX_CMAKE_TOOLCHAINS -DBUILD_THUNKS=ON $CLANG_EXEC_PATH; set +o xtrace"
|