Skip to content

Commit

Permalink
[CMake] Don't set <PROJECT>_STANDALONE_BUILD
Browse files Browse the repository at this point in the history
We shouldn't be treating runtimes builds as standalone builds since
we have enough of the context loaded into the runtimes environment.

Differential Revision: https://reviews.llvm.org/D57992

llvm-svn: 353601
  • Loading branch information
petrhosek committed Feb 9, 2019
1 parent b34fed1 commit 3ef9918
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion compiler-rt/cmake/Modules/AddCompilerRT.cmake
Expand Up @@ -515,7 +515,7 @@ macro(add_custom_libcxx name prefix)
if(LIBCXX_USE_TOOLCHAIN)
set(compiler_args -DCMAKE_C_COMPILER=${COMPILER_RT_TEST_COMPILER}
-DCMAKE_CXX_COMPILER=${COMPILER_RT_TEST_CXX_COMPILER})
if(NOT COMPILER_RT_STANDALONE_BUILD)
if(NOT COMPILER_RT_STANDALONE_BUILD AND NOT RUNTIMES_BUILD)
set(toolchain_deps $<TARGET_FILE:clang>)
set(force_deps DEPENDS $<TARGET_FILE:clang>)
endif()
Expand Down
9 changes: 6 additions & 3 deletions llvm/runtimes/CMakeLists.txt
Expand Up @@ -87,6 +87,7 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})

# This variable makes sure that e.g. llvm-lit is found.
set(LLVM_MAIN_SRC_DIR ${LLVM_BUILD_MAIN_SRC_DIR})
set(LLVM_CMAKE_PATH ${LLVM_MAIN_SRC_DIR}/cmake/modules)

if(APPLE)
set(LLVM_ENABLE_LIBCXX ON CACHE BOOL "")
Expand Down Expand Up @@ -116,26 +117,28 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
# Handle common options used by all runtimes.
include(AddLLVM)
include(HandleLLVMOptions)
include(FindPythonInterp)

set(CMAKE_REQUIRED_FLAGS ${SAFE_CMAKE_REQUIRED_FLAGS})
set(CMAKE_REQUIRED_LIBRARIES ${SAFE_CMAKE_REQUIRED_LIBRARIES})

# This can be used to detect whether we're in the runtimes build.
set(RUNTIMES_BUILD ON)

foreach(entry ${runtimes})
get_filename_component(projName ${entry} NAME)

# TODO: Clean this up as part of an interface standardization
string(REPLACE "-" "_" canon_name ${projName})
string(TOUPPER ${canon_name} canon_name)
# The subdirectories need to treat this as standalone builds
set(${canon_name}_STANDALONE_BUILD On)

if(LLVM_RUNTIMES_LIBDIR_SUFFIX)
set(${canon_name}_LIBDIR_SUFFIX "${LLVM_RUNTIMES_LIBDIR_SUFFIX}" CACHE STRING "" FORCE)
endif()

# Setting a variable to let sub-projects detect which other projects
# will be included under here.
set(HAVE_${canon_name} On)
set(HAVE_${canon_name} ON)
endforeach()

# We do this in two loops so that HAVE_* is set for each runtime before the
Expand Down

0 comments on commit 3ef9918

Please sign in to comment.