mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-23 05:40:09 +00:00
9145bf13b7
These examples are serve as an examples for people wanting to start using the libc. Reviewed By: michaelrj, jeffbailey Differential Revision: https://reviews.llvm.org/D137090
17 lines
507 B
CMake
17 lines
507 B
CMake
function(add_example name)
|
|
add_executable(
|
|
${name}
|
|
${ARGN}
|
|
)
|
|
|
|
if(LIBC_FULLBUILD)
|
|
target_link_options(${name} PRIVATE -static -rtlib=compiler-rt -fuse-ld=lld)
|
|
elseif(LIBC_OVERLAY_ARCHIVE_DIR)
|
|
target_link_directories(${name} PRIVATE ${LIBC_OVERLAY_ARCHIVE_DIR})
|
|
target_link_options(${name} PRIVATE -l:libllvmlibc.a)
|
|
else()
|
|
message(FATAL_ERROR "Either LIBC_FULLBUILD should be on or "
|
|
"LIBC_OVERLAY_ARCHIVE_DIR should be set.")
|
|
endif()
|
|
endfunction()
|