CRT files will now only be reassembled when necessary

This commit is contained in:
2021-08-22 20:06:18 +01:00
parent fdd7f42b55
commit da23bdc56a

View File

@@ -45,9 +45,18 @@ file(GLOB photon_libc_crt
${CMAKE_CURRENT_SOURCE_DIR}/photon/libc/sys/${platform}/machine/${machine}/crt*.s)
message(STATUS "CRT files: ${photon_libc_crt}")
foreach (crt_file ${photon_libc_crt})
get_filename_component(crt_name ${crt_file} NAME_WE)
set(crt_path ${CMAKE_CURRENT_BINARY_DIR}/${crt_name}.o)
set(crt_bin ${crt_bin} ${crt_path})
add_custom_command(
OUTPUT ${crt_path}
COMMAND ${CMAKE_C_COMPILER} -c -ffreestanding ${crt_file}
COMMENT "Assembling ${crt_bin}")
endforeach ()
add_custom_target(crt ALL
DEPENDS ${photon_libc_crt}
COMMAND ${CMAKE_C_COMPILER} -c -ffreestanding ${photon_libc_crt}
DEPENDS ${crt_bin}
COMMENT "Generating CRT files")
file(GLOB platform_sources