-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
47 lines (33 loc) · 1.62 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
45
46
47
# CMakefile from https://github.com/phaser/phOS/blob/master/CMakeLists.txt
cmake_minimum_required (VERSION 3.14.5)
set(CMAKE_BUILD_TYPE Debug)
add_compile_options(-Werror)
set(CMAKE_C_COMPILER ${CMAKE_CURRENT_SOURCE_DIR}/toolchain/local/bin/i686-pc-corax-gcc)
set(CMAKE_C_LINKER ${CMAKE_CURRENT_SOURCE_DIR}/toolchain/local/bin/i686-pc-corax-gcc)
SET (CMAKE_CXX_FLAGS "-m32 -ffreestanding -fno-rtti -fno-exceptions -nostdlib -nostdinc -fno-common -fno-stack-protector")
SET (CMAKE_C_FLAGS "-m32 -ffreestanding -fno-exceptions -nostdlib -nostdinc -fno-common -fno-stack-protector -fno-pic")
SET (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -nostdlib -nostdinc -fno-common")
message("Binary bin: ${CMAKE_BINARY_DIR}")
PROJECT (global_make)
add_subdirectory(kernel)
add_subdirectory(libc)
add_subdirectory(apps)
add_custom_target(os.iso ALL
COMMAND bash make-iso.sh
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
set(QEMUARGS -no-shutdown -no-reboot -s -m 512M -serial file:serial.log -drive format=raw,file=os.iso -vga std)
add_custom_target(run
COMMAND qemu-system-i386 ${QEMUARGS}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
add_custom_target(run-debug
COMMAND qemu-system-i386 -S ${QEMUARGS}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
add_custom_target(debug
COMMAND gdb isofiles/boot/kernel.elf
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
add_dependencies(run os.iso)
add_dependencies(run-debug os.iso)
add_dependencies(debug os.iso)