Better compile options

This commit is contained in:
2024-03-31 23:03:55 +02:00
parent 30f2c0f9b6
commit 6a9653d4ad

View File

@@ -1,9 +1,32 @@
add_executable(kernel.elf)
target_compile_options(kernel.elf PUBLIC $<$<COMPILE_LANGUAGE:CXX>:-fstack-protector-all -Wno-pointer-arith -fsanitize=undefined -ffreestanding -nostdlib -mno-red-zone -mcmodel=large -fno-exceptions -fno-rtti>)
target_compile_options(kernel.elf PUBLIC $<$<COMPILE_LANGUAGE:C>:-fstack-protector-all -Wno-pointer-arith -fsanitize=undefined -ffreestanding -nostdlib -mno-red-zone -mcmodel=large>)
target_link_options(kernel.elf PUBLIC -ffreestanding -nostdlib -mno-red-zone -mcmodel=large -fno-exceptions -fno-rtti)
target_compile_options(kernel.elf PUBLIC $<$<COMPILE_LANGUAGE:CXX>:
-fstack-protector-all
-Wno-pointer-arith
-fsanitize=undefined
-ffreestanding
-nostdlib
-mno-red-zone
-mcmodel=large
-fno-exceptions
-fno-rtti
>)
target_compile_options(kernel.elf PUBLIC $<$<COMPILE_LANGUAGE:C>:
-fstack-protector-all
-Wno-pointer-arith
-fsanitize=undefined
-ffreestanding
-nostdlib
-mno-red-zone
-mcmodel=large>)
target_link_options(kernel.elf PUBLIC
-ffreestanding
-nostdlib
-mno-red-zone
-mcmodel=large
-fno-exceptions
-fno-rtti)
target_include_directories(kernel.elf PRIVATE ${tools}/limine/prefix/include)