From: Eric Fiselier
Date: Sun, 28 Aug 2016 18:16:18 +0000 (+0000)
Subject: [CMake] Apply r279151 cleanup to libc++abi.
X-Git-Tag: llvmorg-4.0.0-rc1~11294
X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4b3308c27feaed28ea2f08860cc2f9aec3c4d642;p=platform%2Fupstream%2Fllvm.git
[CMake] Apply r279151 cleanup to libc++abi.
This patch applies changes similar to those in r279515 to libc++abi.
Summary of changes in this patch:
* Renamed variable LLVM_CONFIG -> LLVM_CONFIG_PATH
* Renamed variable LIBCXXABI_BUILT_STANDALONE -> LIBCXXABI_STANDALONE_BUILD
* Add an include of AddLLVM in the tests subdirectory for add_lit_testsuite.
llvm-svn: 279936
---
diff --git a/libcxxabi/CMakeLists.txt b/libcxxabi/CMakeLists.txt
index 96cbe46..82064ed 100644
--- a/libcxxabi/CMakeLists.txt
+++ b/libcxxabi/CMakeLists.txt
@@ -13,15 +13,17 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
# Rely on llvm-config.
set(CONFIG_OUTPUT)
- find_program(LLVM_CONFIG "llvm-config")
+ if (NOT LLVM_CONFIG_PATH)
+ find_program(LLVM_CONFIG_PATH "llvm-config")
+ endif()
if(DEFINED LLVM_PATH)
set(LLVM_INCLUDE_DIR ${LLVM_INCLUDE_DIR} CACHE PATH "Path to llvm/include")
set(LLVM_PATH ${LLVM_PATH} CACHE PATH "Path to LLVM source tree")
set(LLVM_MAIN_SRC_DIR ${LLVM_PATH})
set(LLVM_CMAKE_PATH "${LLVM_PATH}/cmake/modules")
- elseif(LLVM_CONFIG)
- message(STATUS "Found LLVM_CONFIG as ${LLVM_CONFIG}")
- set(CONFIG_COMMAND ${LLVM_CONFIG}
+ elseif(LLVM_CONFIG_PATH)
+ message(STATUS "Found LLVM_CONFIG_PATH as ${LLVM_CONFIG_PATH}")
+ set(CONFIG_COMMAND ${LLVM_CONFIG_PATH}
"--includedir"
"--prefix"
"--src-root")
@@ -51,7 +53,7 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
set(LLVM_LIT_PATH "${LLVM_PATH}/utils/lit/lit.py")
else()
message(FATAL_ERROR "llvm-config not found and LLVM_MAIN_SRC_DIR not defined. "
- "Reconfigure with -DLLVM_CONFIG=path/to/llvm-config "
+ "Reconfigure with -DLLVM_CONFIG_PATH=path/to/llvm-config "
"or -DLLVM_PATH=path/to/llvm-source-root.")
endif()
@@ -96,7 +98,7 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
set(LIBCXXABI_LIBDIR_SUFFIX "${LLVM_LIBDIR_SUFFIX}" CACHE STRING
"Define suffix of library directory name (32/64)")
- set(LIBCXXABI_BUILT_STANDALONE 1)
+ set(LIBCXXABI_STANDALONE_BUILD 1)
else()
set(LLVM_MAIN_SRC_DIR "${CMAKE_SOURCE_DIR}" CACHE PATH "Path to LLVM source tree")
set(LLVM_LIT "${CMAKE_SOURCE_DIR}/utils/lit/lit.py")
@@ -388,7 +390,7 @@ endif()
# soname, etc...
add_subdirectory(src)
-if (LIBCXXABI_BUILT_STANDALONE AND NOT LIBCXXABI_ENABLE_SHARED)
+if (LIBCXXABI_STANDALONE_BUILD AND NOT LIBCXXABI_ENABLE_SHARED)
# We can't reasonably test the system C++ library with a static libc++abi.
# We either need to be able to replace libc++abi at run time (with a shared
# libc++abi), or we need to be able to replace the C++ runtime (with a non-
diff --git a/libcxxabi/src/CMakeLists.txt b/libcxxabi/src/CMakeLists.txt
index 3af703c..b6fca82 100644
--- a/libcxxabi/src/CMakeLists.txt
+++ b/libcxxabi/src/CMakeLists.txt
@@ -55,7 +55,7 @@ endif()
append_if(libraries LIBCXXABI_HAS_C_LIB c)
if (LIBCXXABI_USE_LLVM_UNWINDER)
- if (NOT LIBCXXABI_BUILT_STANDALONE)
+ if (NOT LIBCXXABI_STANDALONE_BUILD)
if (LIBUNWIND_ENABLE_SHARED)
list(APPEND libraries unwind_shared)
else()
diff --git a/libcxxabi/test/CMakeLists.txt b/libcxxabi/test/CMakeLists.txt
index 3a489bf..e31b525 100644
--- a/libcxxabi/test/CMakeLists.txt
+++ b/libcxxabi/test/CMakeLists.txt
@@ -1,3 +1,4 @@
+include(AddLLVM) # for add_lit_testsuite
macro(pythonize_bool var)
if (${var})
set(${var} True)
@@ -34,7 +35,7 @@ else()
set(LIBCXXABI_TEST_DEPS cxxabi_static)
endif()
-if (NOT LIBCXXABI_BUILT_STANDALONE)
+if (NOT LIBCXXABI_STANDALONE_BUILD)
list(APPEND LIBCXXABI_TEST_DEPS cxx)
if (LIBCXXABI_USE_LLVM_UNWINDER)
list(APPEND LIBCXXABI_TEST_DEPS unwind)
diff --git a/libcxxabi/www/index.html b/libcxxabi/www/index.html
index bf4f8cf..b86306e 100644
--- a/libcxxabi/www/index.html
+++ b/libcxxabi/www/index.html
@@ -104,7 +104,7 @@
configure CMake using either of the following options.
- -DLLVM_CONFIG=path/to/llvm-config
+ -DLLVM_CONFIG_PATH=path/to/llvm-config
-DLLVM_PATH=path/to/llvm-source-root