Skip to content

Commit f184ce5

Browse files
author
Yuanfang Chen
committedJul 26, 2019
[CMake] Allow LLVM_EXTERNAL_<proj>_SOURCE_DIR to be overridden if it is
empty. This makes adding projects to LLVM_ENABLE_PROJECTS possible. Also its type should be PATH. https://bugs.llvm.org/show_bug.cgi?id=42698 Reviewers: beanz, greened, chapuni Reviewed by: beanz Differential Revision: https://reviews.llvm.org/D65045 llvm-svn: 367144
1 parent deea000 commit f184ce5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed
 

‎llvm/CMakeLists.txt

+5-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,11 @@ if (LLVM_ENABLE_PROJECTS_USED OR NOT LLVM_ENABLE_PROJECTS STREQUAL "")
9595
if(NOT EXISTS "${PROJ_DIR}" OR NOT IS_DIRECTORY "${PROJ_DIR}")
9696
message(FATAL_ERROR "LLVM_ENABLE_PROJECTS requests ${proj} but directory not found: ${PROJ_DIR}")
9797
endif()
98-
set(LLVM_EXTERNAL_${upper_proj}_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../${proj}" CACHE STRING "")
98+
if( LLVM_EXTERNAL_${upper_proj}_SOURCE_DIR STREQUAL "" )
99+
set(LLVM_EXTERNAL_${upper_proj}_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../${proj}" CACHE PATH "" FORCE)
100+
else()
101+
set(LLVM_EXTERNAL_${upper_proj}_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../${proj}" CACHE PATH "")
102+
endif()
99103
elseif ("${proj}" IN_LIST LLVM_EXTERNAL_PROJECTS)
100104
message(STATUS "${proj} project is enabled")
101105
set(SHOULD_ENABLE_PROJECT TRUE)

0 commit comments

Comments
 (0)
Please sign in to comment.