-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
51 lines (43 loc) · 981 Bytes
/
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
48
49
50
51
cmake_minimum_required(VERSION 2.8)
project(osldr)
enable_language(ASM-ATT)
add_executable(osldr
# start.s has to come first in the link order; it contains the entry point
# which has to be at the beginning of the file.
src/start.s
src/asm.s
src/config.c
src/conio.c
src/ctype.c
src/drive.c
src/fat.c
src/io.c
src/loader.c
src/main.c
src/mem.c
src/messages.c
src/multiboot.c
src/raw.c
src/stdio.c
src/stdlib.c
src/string.s
src/time.c
src/video.c
)
target_include_directories(osldr
PRIVATE
src
)
target_compile_options(osldr
PRIVATE
$<$<COMPILE_LANGUAGE:C>:-O2 -Wall -pedantic-errors -ffreestanding -fno-builtin -nostdinc -m32>
$<$<COMPILE_LANGUAGE:ASM-ATT>:-32>
)
target_link_libraries(osldr
PRIVATE
gcc # We need this for 64-bit arithmetic
)
set_target_properties(osldr
PROPERTIES
LINK_FLAGS "-nostdlib -m32 -T ${CMAKE_CURRENT_SOURCE_DIR}/osldr.djl"
)