diff --git a/CMakeLists.txt b/CMakeLists.txt index 5a58dbed2df..70bfff60590 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,7 +40,7 @@ option(ENABLE_KERNEL_LTO "Build the kernel with link-time optimization" OFF) include(Meta/CMake/wasm_spec_tests.cmake) add_custom_target(run - COMMAND ${CMAKE_SOURCE_DIR}/Meta/run.sh + COMMAND ${CMAKE_COMMAND} -E env "SERENITY_ARCH=${SERENITY_ARCH}" ${CMAKE_SOURCE_DIR}/Meta/run.sh USES_TERMINAL ) diff --git a/Meta/run.sh b/Meta/run.sh index 533516af322..5999c20828a 100755 --- a/Meta/run.sh +++ b/Meta/run.sh @@ -27,7 +27,13 @@ fi SERENITY_RUN="${SERENITY_RUN:-$1}" -[ -z "$SERENITY_QEMU_BIN" ] && SERENITY_QEMU_BIN="qemu-system-i386" +if [ -z "$SERENITY_QEMU_BIN" ]; then + if [ "$SERENITY_ARCH" = "x86_64" ]; then + SERENITY_QEMU_BIN="qemu-system-x86_64" + else + SERENITY_QEMU_BIN="qemu-system-i386" + fi +fi [ -z "$SERENITY_KERNEL_CMDLINE" ] && SERENITY_KERNEL_CMDLINE="hello"