summaryrefslogtreecommitdiff
path: root/Toolchain/CMakeToolchain.txt
blob: 676ec1c1335313c6b14b96a7e9868c9e489ec560 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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})
    message(FATAL_ERROR "SERENITY_ROOT not set.")
endif()

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti -fno-exceptions")

# where to read from/write to
set(CMAKE_SYSROOT $ENV{SERENITY_ROOT}/Build/Root)
set(CMAKE_STAGING_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_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)