From 594d480391ac7371aaf7837755986fefbed27bec Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Thu, 15 Apr 2021 13:32:29 +0200 Subject: Toolchain+Ports: Move the CMake toolchain file into a subdirectory --- Toolchain/CMake/CMakeToolchain.txt | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 Toolchain/CMake/CMakeToolchain.txt (limited to 'Toolchain/CMake/CMakeToolchain.txt') diff --git a/Toolchain/CMake/CMakeToolchain.txt b/Toolchain/CMake/CMakeToolchain.txt new file mode 100644 index 0000000000..43d0538a9c --- /dev/null +++ b/Toolchain/CMake/CMakeToolchain.txt @@ -0,0 +1,33 @@ +set(CMAKE_SYSTEM_NAME SerenityOS) + +if (NOT DEFINED ENV{SERENITY_ARCH}) + message(FATAL_ERROR "SERENITY_ARCH not set.") +endif() + +if (NOT DEFINED ENV{SERENITY_ROOT}) + message(FATAL_ERROR "SERENITY_ROOT not set.") +endif() + +set(SERENITYOS 1) + +set(CMAKE_SYSTEM_PROCESSOR "$ENV{SERENITY_ARCH}") + +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions") + +set(SERENITY_BUILD_DIR $ENV{SERENITY_ROOT}/Build/$ENV{SERENITY_ARCH}) + +# where to read from/write to +set(CMAKE_SYSROOT ${SERENITY_BUILD_DIR}/Root) +set(CMAKE_STAGING_PREFIX ${SERENITY_BUILD_DIR}/Root/usr) +set(CMAKE_INSTALL_PREFIX ${SERENITY_BUILD_DIR}/Root/usr) +set(CMAKE_INSTALL_DATAROOTDIR ${SERENITY_BUILD_DIR}/Root/usr/share) + +set(CMAKE_C_COMPILER $ENV{SERENITY_ARCH}-pc-serenity-gcc) +set(CMAKE_CXX_COMPILER $ENV{SERENITY_ARCH}-pc-serenity-g++) + +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) + +list(APPEND CMAKE_MODULE_PATH "$ENV{SERENITY_ROOT}/Toolchain/CMake") -- cgit v1.2.3