1 function(add_startup_object name)
4 "ALIAS" # Option argument
5 "SRC" # Single value arguments
6 "DEPENDS;COMPILE_OPTIONS" # Multi value arguments
10 get_fq_target_name(${name} fq_target_name)
11 if(ADD_STARTUP_OBJECT_ALIAS)
12 get_fq_deps_list(fq_dep_list ${ADD_STARTUP_OBJECT_DEPENDS})
13 add_library(${fq_target_name} ALIAS ${fq_dep_list})
19 SRCS ${ADD_STARTUP_OBJECT_SRC}
20 DEPENDS ${ADD_STARTUP_OBJECT_DEPENDS}
21 COMPILE_OPTIONS ${ADD_STARTUP_OBJECT_COMPILE_OPTIONS}
23 set_target_properties(
30 if(NOT (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${LIBC_TARGET_ARCHITECTURE}))
31 message(STATUS "Skipping startup for target architecture ${LIBC_TARGET_ARCHITECTURE}")
35 add_subdirectory(${LIBC_TARGET_ARCHITECTURE})
41 .${LIBC_TARGET_ARCHITECTURE}.crt1
56 add_custom_target(libc-startup)
57 set(startup_components crt1 crti crtn)
58 foreach(target IN LISTS startup_components)
59 set(fq_target_name libc.startup.linux.${target})
60 add_dependencies(libc-startup ${fq_target_name})
61 install(FILES $<TARGET_OBJECTS:${fq_target_name}>
62 DESTINATION ${CMAKE_INSTALL_LIBDIR}
63 RENAME $<TARGET_PROPERTY:${fq_target_name},OUTPUT_NAME>