llvm-project
16 строк · 519.0 Байт
1function(add_example name)
2add_executable(
3${name}
4${ARGN}
5)
6
7if(LLVM_LIBC_FULL_BUILD)
8target_link_options(${name} PRIVATE -static -rtlib=compiler-rt -fuse-ld=lld)
9elseif(LIBC_OVERLAY_ARCHIVE_DIR)
10target_link_directories(${name} PRIVATE ${LIBC_OVERLAY_ARCHIVE_DIR})
11target_link_options(${name} PRIVATE -l:libllvmlibc.a)
12else()
13message(FATAL_ERROR "Either LLVM_LIBC_FULL_BUILD should be on or "
14"LIBC_OVERLAY_ARCHIVE_DIR should be set.")
15endif()
16endfunction()
17