File tree Expand file tree Collapse file tree 3 files changed +16
-10
lines changed Expand file tree Collapse file tree 3 files changed +16
-10
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,8 @@ set(LLVM_COMMON_CMAKE_UTILS ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)
4545list (INSERT CMAKE_MODULE_PATH 0
4646 "${CMAKE_CURRENT_SOURCE_DIR} /cmake"
4747 "${CMAKE_CURRENT_SOURCE_DIR} /cmake/Modules"
48+ "${CMAKE_CURRENT_SOURCE_DIR} /../runtimes/cmake/Modules"
49+ "${LLVM_COMMON_CMAKE_UTILS} "
4850 "${LLVM_COMMON_CMAKE_UTILS} /Modules"
4951 )
5052
Original file line number Diff line number Diff line change @@ -22,17 +22,16 @@ if (NOT LLVM_LINK_LLVM_DYLIB)
2222endif ()
2323
2424# Include the RPC server from the `libc` project if availible.
25+ include (FindLibcCommonUtils)
2526if (TARGET llvmlibc_rpc_server AND ${LIBOMPTARGET_GPU_LIBC_SUPPORT} )
26- target_link_libraries (PluginCommon PRIVATE llvmlibc_rpc_server)
27+ target_link_libraries (PluginCommon PRIVATE llvmlibc_rpc_server llvm-libc-common-utilities )
2728 target_compile_definitions (PluginCommon PRIVATE LIBOMPTARGET_RPC_SUPPORT)
2829elseif (${LIBOMPTARGET_GPU_LIBC_SUPPORT} )
2930 find_library (llvmlibc_rpc_server NAMES llvmlibc_rpc_server
3031 PATHS ${LIBOMPTARGET_LLVM_LIBRARY_DIR} NO_DEFAULT_PATH)
3132 if (llvmlibc_rpc_server)
32- target_link_libraries (PluginCommon PRIVATE ${llvmlibc_rpc_server} )
33+ target_link_libraries (PluginCommon PRIVATE ${llvmlibc_rpc_server} llvm-libc-common-utilities )
3334 target_compile_definitions (PluginCommon PRIVATE LIBOMPTARGET_RPC_SUPPORT)
34- # We may need to get the headers directly from the 'libc' source directory.
35- target_include_directories (PluginCommon PRIVATE ${CMAKE_SOURCE_DIR} /../libc/)
3635 endif ()
3736endif ()
3837
Original file line number Diff line number Diff line change 66#
77#===--------------------------------------------------------------------===//
88
9- add_library (llvm-libc-common-utilities INTERFACE )
10- # TODO: Reorganize the libc shared section so that it can be included without
11- # adding the root "libc" directory to the include path.
12- target_include_directories (llvm-libc-common-utilities INTERFACE ${CMAKE_CURRENT_LIST_DIR} /../../../libc)
13- target_compile_definitions (llvm-libc-common-utilities INTERFACE LIBC_NAMESPACE=__llvm_libc_common_utils)
14- target_compile_features (llvm-libc-common-utilities INTERFACE cxx_std_17)
9+ if (NOT TARGET llvm-libc-common-utilities)
10+ set (libc_path ${CMAKE_CURRENT_LIST_DIR} /../../../libc)
11+ if (EXISTS ${libc_path} AND IS_DIRECTORY ${libc_path} )
12+ add_library (llvm-libc-common-utilities INTERFACE )
13+ # TODO: Reorganize the libc shared section so that it can be included without
14+ # adding the root "libc" directory to the include path.
15+ target_include_directories (llvm-libc-common-utilities INTERFACE ${libc_path} )
16+ target_compile_definitions (llvm-libc-common-utilities INTERFACE LIBC_NAMESPACE=__llvm_libc_common_utils)
17+ target_compile_features (llvm-libc-common-utilities INTERFACE cxx_std_17)
18+ endif ()
19+ endif ()
You can’t perform that action at this time.
0 commit comments