@@ -502,10 +502,18 @@ if(build_runtimes)
502
502
endif ()
503
503
504
504
# Forward user-provived system configuration to runtimes for requirement introspection.
505
- # CMAKE_PREFIX_PATH is the search path for CMake packages.
505
+ # CMAKE_PREFIX_PATH is the search path for CMake packages. In order to pass through
506
+ # the command line interface, the CMake semicolon separator needs to be replaced
507
+ # with $<SEMICOLON>
506
508
if (CMAKE_PREFIX_PATH )
507
- list (APPEND extra_cmake_args "-DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} " )
509
+ string (JOIN "$<SEMICOLON>" escaped_cmake_prefix_path ${CMAKE_PREFIX_PATH} )
510
+ # Some projects require access to the LLVM lib/cmake directory
511
+ if (OFFLOAD_EXTERNAL_PROJECT_UNIFIED_ROCR OR DEFINED LIBOMPTARGET_EXTERNAL_PROJECT_ROCM_DEVICE_LIBS_PATH)
512
+ string (PREPEND escaped_cmake_prefix_path "${CMAKE_BINARY_DIR} /lib/cmake$<SEMICOLON>" )
513
+ endif ()
514
+ list (APPEND extra_cmake_args "-DCMAKE_PREFIX_PATH=${escaped_cmake_prefix_path} " )
508
515
endif ()
516
+
509
517
# CMAKE_PROGRAM_PATH is the search path for executables such as python.
510
518
if (CMAKE_PROGRAM_PATH )
511
519
list (APPEND extra_cmake_args "-DCMAKE_PROGRAM_PATH=${CMAKE_PROGRAM_PATH} " )
@@ -522,9 +530,6 @@ if(build_runtimes)
522
530
if ("openmp" IN_LIST LLVM_ENABLE_RUNTIMES OR "offload" IN_LIST LLVM_ENABLE_RUNTIMES)
523
531
# With ROCm 6.3 the ROCr runtime and the thunk layer share a single repository.
524
532
# No need to provide a separate path for ROCt.
525
- if (OFFLOAD_EXTERNAL_PROJECT_UNIFIED_ROCR OR DEFINED LIBOMPTARGET_EXTERNAL_PROJECT_ROCM_DEVICE_LIBS_PATH)
526
- list (APPEND extra_cmake_args "-DCMAKE_PREFIX_PATH=${CMAKE_BINARY_DIR} /lib/cmake$<SEMICOLON>${CMAKE_PREFIX_PATH} " )
527
- endif ()
528
533
if (OFFLOAD_EXTERNAL_PROJECT_UNIFIED_ROCR)
529
534
if (NOT DEFINED LIBOMPTARGET_EXTERNAL_PROJECT_HSA_PATH)
530
535
message (SEND_ERROR "External ROCr requires setting LIBOMPTARGET_EXTERNAL_PROJECT_HSA_PATH" )
0 commit comments