forked from Bananymous/banan-os
BuildSystem: Fix header copying to sysroot
We used to copy all headers everytime to sysroot which caused rebuild of the whole os. Now we use the cmake command 'copy_directory_if_different' which seemed to fix this issue :)
This commit is contained in:
parent
e704968f96
commit
c660df14ec
|
@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.26)
|
||||||
project(BAN CXX)
|
project(BAN CXX)
|
||||||
|
|
||||||
add_custom_target(ban-headers
|
add_custom_target(ban-headers
|
||||||
COMMAND cp -r ${CMAKE_CURRENT_SOURCE_DIR}/include/* ${BANAN_INCLUDE}
|
COMMAND ${CMAKE_COMMAND} -E copy_directory_if_different ${CMAKE_CURRENT_SOURCE_DIR}/include ${BANAN_INCLUDE}
|
||||||
DEPENDS sysroot
|
DEPENDS sysroot
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -97,6 +97,7 @@ set(KERNEL_SOURCES
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(kernel ${KERNEL_SOURCES})
|
add_executable(kernel ${KERNEL_SOURCES})
|
||||||
|
add_dependencies(kernel headers)
|
||||||
|
|
||||||
target_compile_definitions(kernel PUBLIC __is_kernel)
|
target_compile_definitions(kernel PUBLIC __is_kernel)
|
||||||
target_compile_definitions(kernel PUBLIC __arch=${BANAN_ARCH})
|
target_compile_definitions(kernel PUBLIC __arch=${BANAN_ARCH})
|
||||||
|
@ -126,13 +127,12 @@ add_custom_target(crt0
|
||||||
)
|
)
|
||||||
|
|
||||||
add_custom_target(kernel-headers
|
add_custom_target(kernel-headers
|
||||||
COMMAND cp -r ${CMAKE_CURRENT_SOURCE_DIR}/include/* ${BANAN_INCLUDE}/
|
COMMAND ${CMAKE_COMMAND} -E copy_directory_if_different ${CMAKE_CURRENT_SOURCE_DIR}/include ${BANAN_INCLUDE}
|
||||||
DEPENDS sysroot
|
DEPENDS sysroot
|
||||||
)
|
)
|
||||||
|
|
||||||
add_custom_target(kernel-install
|
add_custom_target(kernel-install
|
||||||
COMMAND cp ${CMAKE_CURRENT_BINARY_DIR}/kernel ${BANAN_BOOT}/banan-os.kernel
|
COMMAND cp ${CMAKE_CURRENT_BINARY_DIR}/kernel ${BANAN_BOOT}/banan-os.kernel
|
||||||
DEPENDS kernel-headers
|
|
||||||
DEPENDS kernel
|
DEPENDS kernel
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -11,12 +11,12 @@ set(LIBC_SOURCES
|
||||||
)
|
)
|
||||||
|
|
||||||
add_custom_target(libc-headers
|
add_custom_target(libc-headers
|
||||||
COMMAND cp -r ${CMAKE_CURRENT_SOURCE_DIR}/include/* ${BANAN_INCLUDE}
|
COMMAND ${CMAKE_COMMAND} -E copy_directory_if_different ${CMAKE_CURRENT_SOURCE_DIR}/include ${BANAN_INCLUDE}
|
||||||
DEPENDS sysroot
|
DEPENDS sysroot
|
||||||
)
|
)
|
||||||
|
|
||||||
add_library(libc ${LIBC_SOURCES})
|
add_library(libc ${LIBC_SOURCES})
|
||||||
add_dependencies(libc crt0)
|
add_dependencies(libc headers crt0)
|
||||||
|
|
||||||
add_custom_target(libc-install
|
add_custom_target(libc-install
|
||||||
COMMAND cp ${CMAKE_CURRENT_BINARY_DIR}/libc.a ${BANAN_LIB}/
|
COMMAND cp ${CMAKE_CURRENT_BINARY_DIR}/libc.a ${BANAN_LIB}/
|
||||||
|
|
Loading…
Reference in New Issue