[libcxx] Unify LIBCXX_<ABI-Name>_INCLUDE_PATHS to be LIBCXX_CXX_ABI_INCLUDE_PATHS
Summary: Clean up all the different possible CMake options for specifying the ABI include paths into one CMake option named `LIBCXX_CXX_ABI_INCLUDE_PATHS`. The documentation has been updated to reflect this change. For the next week I have added explicit errors if any of the old flags is used. These errors inform users of the change and the new option to use. Before committing the change I will announce this change on cfe-dev. Reviewers: danalbert, mclow.lists Reviewed By: danalbert, mclow.lists Subscribers: jroelofs, cbergstrom, cfe-commits Differential Revision: http://reviews.llvm.org/D5039 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@232762 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
64befb5bc5
commit
02c24c1d3b
@ -83,7 +83,7 @@ if (NOT LIBCXX_CXX_ABI)
|
||||
if (NOT DEFINED LIBCXX_BUILT_STANDALONE AND
|
||||
IS_DIRECTORY "${CMAKE_SOURCE_DIR}/projects/libcxxabi")
|
||||
set(LIBCXX_CXX_ABI_LIBNAME "libcxxabi")
|
||||
set(LIBCXX_LIBCXXABI_INCLUDE_PATHS "${CMAKE_SOURCE_DIR}/projects/libcxxabi/include")
|
||||
set(LIBCXX_CXX_ABI_INCLUDE_PATHS "${CMAKE_SOURCE_DIR}/projects/libcxxabi/include")
|
||||
set(LIBCXX_CXX_ABI_INTREE 1)
|
||||
else ()
|
||||
set(LIBCXX_CXX_ABI_LIBNAME "none")
|
||||
@ -95,6 +95,27 @@ set(LIBCXX_CXX_ABI "${LIBCXX_CXX_ABI}" CACHE STRING
|
||||
"Specify C++ ABI library to use." FORCE)
|
||||
set_property(CACHE LIBCXX_CXX_ABI PROPERTY STRINGS ;${CXXABIS})
|
||||
|
||||
# TODO(ericwf): Remove these options by March/25/2015.
|
||||
# These CMake options have been removed in favor of a generic option
|
||||
# "LIBCXX_CXX_ABI_INCLUDE_PATHS". Issue an explicit error message explaining
|
||||
# the change for anybody that still uses them.
|
||||
if (DEFINED LIBCXX_LIBCXXABI_INCLUDE_PATHS)
|
||||
message(FATAL_ERROR
|
||||
"The option \"LIBCXX_LIBCXXABI_INCLUDE_PATHS\" has been removed. "
|
||||
"Use \"LIBCXX_CXX_ABI_INCLUDE_PATHS\" instead "
|
||||
"and clean your build directory.")
|
||||
elseif(DEFINED LIBCXX_LIBSUPCXX_INCLUDE_PATHS)
|
||||
message(FATAL_ERROR
|
||||
"The option \"LIBCXX_LIBSUPCXX_INCLUDE_PATHS\" has been removed. "
|
||||
"Use \"LIBCXX_CXX_ABI_INCLUDE_PATHS\" instead "
|
||||
"and clean your build directory.")
|
||||
elseif(DEFINED LIBCXX_LIBCXXRT_INCLUDE_PATHS)
|
||||
message(FATAL_ERROR
|
||||
"The option \"LIBCXX_LIBCXXRT_INCLUDE_PATHS\" has been removed. "
|
||||
"Use \"LIBCXX_CXX_ABI_INCLUDE_PATHS\" instead "
|
||||
"and clean your build directory.")
|
||||
endif()
|
||||
|
||||
#===============================================================================
|
||||
# Configure System
|
||||
#===============================================================================
|
||||
|
@ -15,9 +15,9 @@
|
||||
# abidirs : A list of relative paths to create under an include directory
|
||||
# in the libc++ build directory.
|
||||
#
|
||||
macro(setup_abi_lib abipathvar abidefines abilib abifiles abidirs)
|
||||
macro(setup_abi_lib abidefines abilib abifiles abidirs)
|
||||
list(APPEND LIBCXX_COMPILE_FLAGS ${abidefines})
|
||||
set(${abipathvar} "${${abipathvar}}"
|
||||
set(LIBCXX_CXX_ABI_INCLUDE_PATHS "${LIBCXX_CXX_ABI_INCLUDE_PATHS}"
|
||||
CACHE PATH
|
||||
"Paths to C++ ABI header directories separated by ';'." FORCE
|
||||
)
|
||||
@ -33,7 +33,7 @@ macro(setup_abi_lib abipathvar abidefines abilib abifiles abidirs)
|
||||
|
||||
foreach(fpath ${LIBCXX_ABILIB_FILES})
|
||||
set(found FALSE)
|
||||
foreach(incpath ${${abipathvar}})
|
||||
foreach(incpath ${LIBCXX_CXX_ABI_INCLUDE_PATHS})
|
||||
if (EXISTS "${incpath}/${fpath}")
|
||||
set(found TRUE)
|
||||
get_filename_component(dstdir ${fpath} PATH)
|
||||
@ -71,7 +71,7 @@ if ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "libstdc++" OR
|
||||
set(_LIBSUPCXX_DEFINES "")
|
||||
set(_LIBSUPCXX_LIBNAME supc++)
|
||||
endif()
|
||||
setup_abi_lib("LIBCXX_LIBSUPCXX_INCLUDE_PATHS"
|
||||
setup_abi_lib(
|
||||
"-D__GLIBCXX__ ${_LIBSUPCXX_DEFINES}"
|
||||
"${_LIBSUPCXX_LIBNAME}" "${_LIBSUPCXX_INCLUDE_FILES}" "bits"
|
||||
)
|
||||
@ -88,11 +88,11 @@ elseif ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "libcxxabi")
|
||||
# Assume c++abi is installed in the system, rely on -lc++abi link flag.
|
||||
set(CXXABI_LIBNAME "c++abi")
|
||||
endif()
|
||||
setup_abi_lib("LIBCXX_LIBCXXABI_INCLUDE_PATHS" ""
|
||||
setup_abi_lib(""
|
||||
${CXXABI_LIBNAME} "cxxabi.h;__cxxabi_config.h" ""
|
||||
)
|
||||
elseif ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "libcxxrt")
|
||||
setup_abi_lib("LIBCXX_LIBCXXRT_INCLUDE_PATHS" "-DLIBCXXRT"
|
||||
setup_abi_lib("-DLIBCXXRT"
|
||||
"cxxrt" "cxxabi.h;unwind.h;unwind-arm.h;unwind-itanium.h" ""
|
||||
)
|
||||
elseif (NOT "${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "none")
|
||||
|
@ -201,7 +201,7 @@
|
||||
<li><code>cd libcxx</code></li>
|
||||
<li><code>mkdir build && cd build</code></li>
|
||||
<li><code>cmake -DLIBCXX_CXX_ABI=libcxxabi
|
||||
-DLIBCXX_LIBCXXABI_INCLUDE_PATHS=path/to/libcxxabi/include
|
||||
-DLIBCXX_CXX_ABI_INCLUDE_PATHS=path/to/libcxxabi/include
|
||||
-DLIT_EXECUTABLE=path/to/llvm/utils/lit/lit.py .. # Linux may require
|
||||
-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++</code></li>
|
||||
<li><code>make</code></li>
|
||||
@ -373,7 +373,7 @@ End of search list.
|
||||
<ul>
|
||||
<li><code>CC=clang CXX=clang++ cmake -G "Unix Makefiles"
|
||||
-DLIBCXX_CXX_ABI=libstdc++
|
||||
-DLIBCXX_LIBSUPCXX_INCLUDE_PATHS="/usr/include/c++/4.7/;/usr/include/c++/4.7/x86_64-linux-gnu/"
|
||||
-DLIBCXX_CXX_ABI_INCLUDE_PATHS="/usr/include/c++/4.7/;/usr/include/c++/4.7/x86_64-linux-gnu/"
|
||||
-DCMAKE_BUILD_TYPE=Release
|
||||
-DCMAKE_INSTALL_PREFIX=/usr
|
||||
<libc++-source-dir></code></li>
|
||||
@ -408,7 +408,7 @@ End of search list.
|
||||
<ul>
|
||||
<li><code>CC=clang CXX=clang++ cmake -G "Unix Makefiles"
|
||||
-DLIBCXX_CXX_ABI=libcxxrt
|
||||
-DLIBCXX_LIBCXXRT_INCLUDE_PATHS="<libcxxrt-source-dir>/src"
|
||||
-DLIBCXX_CXX_ABI_INCLUDE_PATHS="<libcxxrt-source-dir>/src"
|
||||
-DCMAKE_BUILD_TYPE=Release
|
||||
-DCMAKE_INSTALL_PREFIX=/usr
|
||||
<libc++-source-dir></code></li>
|
||||
@ -450,7 +450,7 @@ End of search list.
|
||||
<ul>
|
||||
<li><code>CC=clang CXX=clang++ cmake
|
||||
-DLIBCXX_CXX_ABI=libc++abi
|
||||
-DLIBCXX_LIBCXXABI_INCLUDE_PATHS="/path/to/libcxxabi/include"
|
||||
-DLIBCXX_CXX_ABI_INCLUDE_PATHS="/path/to/libcxxabi/include"
|
||||
-DLIBCXX_CXX_ABI_LIBRARY_PATH="/path/to/libcxxabi-build/lib"
|
||||
path/to/libcxx</code></li>
|
||||
<li><code>make</code></li>
|
||||
|
Loading…
Reference in New Issue
Block a user