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")
"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
#===============================================================================
# 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
)
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)
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"
)
# 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")
<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>
<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>
<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>
<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>