mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
Kernel: Add explicit __serenity__ define to workaround CLion problem
CLion doesn't understand that we switch compilers mid-build (which I can understand since it's a bit unusual.) Defining __serenity__ makes the majority of IDE features work correctly in the kernel context.
This commit is contained in:
parent
f8c352a022
commit
ba42d741cb
Notes:
sideshowbarker
2024-07-18 22:25:38 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/ba42d741cb3
1 changed files with 7 additions and 1 deletions
|
@ -300,13 +300,19 @@ foreach(flag IN LISTS KERNEL_FSANITIZE_FLAGS)
|
|||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=${flag}")
|
||||
endforeach()
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unknown-warning-option -DKERNEL")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unknown-warning-option")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pie -fPIE -fno-rtti -ffreestanding -fbuiltin")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mno-80387 -mno-mmx -mno-sse -mno-sse2")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-asynchronous-unwind-tables")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstack-protector-strong")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -nostdlib -nostdinc -nostdinc++")
|
||||
|
||||
add_compile_definitions(KERNEL)
|
||||
|
||||
# HACK: This is a workaround for CLion to grok the kernel sources.
|
||||
# It's needed because CLion doesn't understand the way we switch compilers mid-build.
|
||||
add_compile_definitions(__serenity__)
|
||||
|
||||
add_link_options(LINKER:-T ${CMAKE_CURRENT_BINARY_DIR}/linker.ld -nostdlib)
|
||||
|
||||
add_library(boot OBJECT Arch/i386/Boot/boot.S)
|
||||
|
|
Loading…
Reference in a new issue