File tree 3 files changed +16
-10
lines changed
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)
45
45
list (INSERT CMAKE_MODULE_PATH 0
46
46
"${CMAKE_CURRENT_SOURCE_DIR} /cmake"
47
47
"${CMAKE_CURRENT_SOURCE_DIR} /cmake/Modules"
48
+ "${CMAKE_CURRENT_SOURCE_DIR} /../runtimes/cmake/Modules"
49
+ "${LLVM_COMMON_CMAKE_UTILS} "
48
50
"${LLVM_COMMON_CMAKE_UTILS} /Modules"
49
51
)
50
52
Original file line number Diff line number Diff line change @@ -22,17 +22,16 @@ if (NOT LLVM_LINK_LLVM_DYLIB)
22
22
endif ()
23
23
24
24
# Include the RPC server from the `libc` project if availible.
25
+ include (FindLibcCommonUtils)
25
26
if (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 )
27
28
target_compile_definitions (PluginCommon PRIVATE LIBOMPTARGET_RPC_SUPPORT)
28
29
elseif (${LIBOMPTARGET_GPU_LIBC_SUPPORT} )
29
30
find_library (llvmlibc_rpc_server NAMES llvmlibc_rpc_server
30
31
PATHS ${LIBOMPTARGET_LLVM_LIBRARY_DIR} NO_DEFAULT_PATH)
31
32
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 )
33
34
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/)
36
35
endif ()
37
36
endif ()
38
37
Original file line number Diff line number Diff line change 6
6
#
7
7
#===--------------------------------------------------------------------===//
8
8
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