diff options
| author | Felix Morgner <felix.morgner@ost.ch> | 2025-07-24 15:05:17 +0000 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@ost.ch> | 2025-07-24 15:05:17 +0000 |
| commit | 2b8fafa2bddc48ddec047de517115c8e65ee61e8 (patch) | |
| tree | 7ccec50eedba9c4e7c4bbabdf9f7ffd38c89d282 | |
| parent | ef907825e861b63726952bb34b425a98f34ed412 (diff) | |
| download | teachos-2b8fafa2bddc48ddec047de517115c8e65ee61e8.tar.xz teachos-2b8fafa2bddc48ddec047de517115c8e65ee61e8.zip | |
build: move linker script dependency to kernel
| -rw-r--r-- | CMakeLists.txt | 7 | ||||
| -rw-r--r-- | arch/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | arch/x86_64/CMakeLists.txt | 8 |
3 files changed, 9 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 9a6dabc..aa1f6a9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,10 +47,17 @@ target_link_libraries("kernel" PRIVATE ) target_link_options("kernel" PRIVATE + "-T${KERNEL_LINKER_SCRIPT}" "-no-pie" "-nostdlib" ) +set_property(TARGET "kernel" + APPEND + PROPERTY LINK_DEPENDS + "${KERNEL_LINKER_SCRIPT}" +) + target_disassemble("kernel") target_extract_debug_symbols("kernel") target_strip("kernel") diff --git a/arch/CMakeLists.txt b/arch/CMakeLists.txt index 661de26..83da439 100644 --- a/arch/CMakeLists.txt +++ b/arch/CMakeLists.txt @@ -23,3 +23,5 @@ target_link_libraries("arch-any" INTERFACE ) add_subdirectory("${CMAKE_SYSTEM_PROCESSOR}") + +set(KERNEL_LINKER_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_SYSTEM_PROCESSOR}/scripts/kernel.ld" PARENT_SCOPE) diff --git a/arch/x86_64/CMakeLists.txt b/arch/x86_64/CMakeLists.txt index 58daa3b..431520e 100644 --- a/arch/x86_64/CMakeLists.txt +++ b/arch/x86_64/CMakeLists.txt @@ -11,14 +11,6 @@ target_link_libraries("arch-x86_64" PUBLIC "libs::multiboot2" ) -target_link_options("arch-x86_64" PUBLIC - "-T${CMAKE_CURRENT_SOURCE_DIR}/scripts/kernel.ld" -) - -set_target_properties("arch-x86_64" PROPERTIES - LINK_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/scripts/kernel.ld" -) - #[============================================================================[ # arch::any Implementation #]============================================================================] |
