Skip to content

Fixed malformed path with double slash in CMakeLists.txt #21093

@x12301450

Description

@x12301450

Explain what you would like to see improved and how.

In line 343 of interpreter/CMakeLists.txt, you defined ROOT_LLVM_MAIN_SRC_DIR with trailing slash.

set(ROOT_LLVM_MAIN_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/llvm-project/llvm/")

In the following codes, this path is used to construct new paths with other paths with leading slashes, which leads to malformed paths with double slash:

if(EXISTS ${ROOT_LLVM_MAIN_SRC_DIR}/utils/lit/lit.py)
set(LLVM_LIT ${ROOT_LLVM_MAIN_SRC_DIR}/utils/lit/lit.py CACHE PATH "The location of the lit test runner.")
add_subdirectory(${ROOT_LLVM_MAIN_SRC_DIR}/utils/FileCheck utils/FileCheck)
add_subdirectory(${ROOT_LLVM_MAIN_SRC_DIR}/utils/count utils/count)
add_subdirectory(${ROOT_LLVM_MAIN_SRC_DIR}/utils/not utils/not)
...

I think it's better to remove the trailing slash at the time of definition:

set(ROOT_LLVM_MAIN_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/llvm-project/llvm")

ROOT version

N/A

Installation method

N/A

Operating system

N/A

Additional context

No response

Metadata

Metadata

Assignees

Type

No type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions