forked from SCSLaboratory/BearOS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
44 lines (32 loc) · 1.55 KB
/
CMakeLists.txt
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# CMakeLists.txt.standalone -- Used to build the system for the Dell Optiplex
# without any networking or services.
# This file is used by "mkall -s"
cmake_minimum_required (VERSION 2.8)
set(CMAKE_C_COMPILER "gcc")
project (BEAR)
set(DEFAULT_FLAGS "-ggdb -fno-pie -fno-builtin -ffreestanding -fno-stack-protector -mcmodel=large -nostdinc -nostdlib -MMD -DSTANDALONE -DKERNEL_DEBUG")
set(SYSTEM_FLAGS "-DSERIAL_OUT_SYSTEM -DDDIVERSITY -DENABLE_SMP -DDXONLY_BEAR_HYPV -DDEBUG -DDEBUG_TSC -DQEMU")
# USER_FLAGS: NFS used in the system only for compilation -- not in default flags
set(USER_FLAGS "${DEFAULT_FLAGS} -DUSER -ffunction-sections -DBEARNFS")
# Set temporary GCC include directories
set(GCC_INCLUDE_DIR "/usr/lib/gcc/x86_64-linux-gnu/5/include")
# Enable verbose compiling
#set(CMAKE_VERBOSE_MAKEFILE on)
# Enable C-language and ASM
enable_language(C ASM)
# Endable testing
enable_testing()
# Set the output paths for libraries and executables
set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
set(CMAKE_SHARED_LIBRARY_C_FLAGS) # remove -fPIC
set(CMAKE_EXE_LINK_DYNAMIC_C_FLAGS) # remove -Wl,-Bdynamic
set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS) # remove -rdynamic
set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE)
# Set the global include directory
set(USER_INCLUDES ${BEAR_SOURCE_DIR}/usr/include
${GCC_INCLUDE_DIR})
# Start adding the source tree to cmake's compilation process
# shared comes first as it is referenced by both, sys and usr
add_subdirectory(sys)
add_subdirectory(usr)