summaryrefslogtreecommitdiffstats
path: root/libcxx/cmake/Modules
Commit message (Collapse)AuthorAgeFilesLines
...
* Improve CMake and LIT support for WindowsEric Fiselier2017-01-161-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch contains multiple cleanups and fixes to better support building on Windows. * [Test] Fix handling of library runtime search paths by correctly adding them to the PATH variable when running the tests. * [Test] Don't explicitly force "--target=i686-pc-windows" when running the test suite. Clang++ seems to deduce the correct target. * [Test] Fix `.sh.cpp` tests on Windows by properly escaping flags used in shell commands. Specifically windows style paths which included spaces were causing these tests to fail. * [CMake] Add "vcruntime" to the list of supported C++ ABI libraries in CMake, and teach the test suite how to handle it. For now libc++ defaults to using "vcruntime" on Windows except when libc++abi is in tree; That is probably a bug and should be changed to always use vcruntime, at least for now. * [Misc] Move the "c++-build" include directory to the libc++ binary dir instead of the top level project dir and rename it "c++build". This is just misc cleanup. Libc++ shouldn't be creating internal build files and directories at the top-level projects root. * [Misc] Build type_info's destructor when building for MSVC. This is a temporary work around to prevent link errors until we have a proper type_info implementation. llvm-svn: 292157
* Reland "[CMake][libcxx] Move Python check to main CMake file"Petr Hosek2017-01-161-7/+0
| | | | | | This relands commit r291728. llvm-svn: 292084
* Fix copy-paste errors in r292001Eric Fiselier2017-01-141-3/+3
| | | | llvm-svn: 292010
* [libc++] [CMake] Link with /nodefaultlibs on WindowsEric Fiselier2017-01-141-0/+4
| | | | | | | | | | | | | | | | Summary: This patch attempts to fix the libc++ build/link so that it doesn't use an default C++ libraries on Windows. This is needed to prevent linking to MSVC's STL library. Additionally this patch changes libc++ so that it is always linked with the non-debug DLL's (e.g. `/MD`). This is needed so that the test suite can correctly link the same libraries without needing to know which configuration `c++.dll` was linked with. Reviewers: compnerd, rnk, majnemer, kimgr, awson, halyavin, smeenai Subscribers: cfe-commits, mgorny Differential Revision: https://reviews.llvm.org/D28441 llvm-svn: 292001
* Don't dump llvm-config --cmakedir output if command fails.Eric Fiselier2017-01-141-1/+2
| | | | | | | | This patch adjusts the out-of-tree CMake configuration so that the stderr output is ignored when an old llvm-config is found that doesn't support --cmakedir. llvm-svn: 291991
* Revert "[CMake][libcxx] Move Python check to main CMake file"Petr Hosek2017-01-111-0/+7
| | | | | | This reverts commit 39441fe9f00a58ffc2fdff92a4b0e8a280a5f444. llvm-svn: 291728
* [CMake][libcxx] Move Python check to main CMake filePetr Hosek2017-01-101-7/+0
| | | | | | | | | | This is to make sure this check is called even when building as part of LLVM runtimes when we are doing standalone but not out of tree build. Differential Revision: https://reviews.llvm.org/D28392 llvm-svn: 291592
* [cmake] Obtain LLVM_CMAKE_PATH from llvm-config if availableMichal Gorny2017-01-091-1/+12
| | | | | | | | Use the new --cmakedir option to obtain LLVM_CMAKE_PATH straight from llvm-config. Fallback to local reconstruction if llvm-config does not support this option. llvm-svn: 291508
* PR31540: install libc++abi headers into include/c++/v1 in build area.Richard Smith2017-01-051-1/+9
| | | | | | This allows an in-build-area clang binary to find <cxxabi.h>. llvm-svn: 291065
* Recommit r290839 - Fix configuring and building libc++ w/o an ABI library.Eric Fiselier2017-01-031-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch re-commits a previous attempt to support building libc++ w/o an ABI library. That patch was originally reverted because: 1) It forgot to teach the test suite about "default" ABI libraries. 2) Some LLVM builders don't clear the CMake cache between builds. The previous patch caused those builders to fail since their old cache entry for LIBCXX_CXX_ABI="" is no longer valid. The updated patch addresses both issues. It works around (2) by adding a hack to force the builders to update their cache entries. The hack will be removed shortly once all LLVM builders have run. Original commit message ----------------------- Typically libc++ uses libc++abi or libcxxrt to provide the ABI and runtime bits of the C++ STL. However we also support building w/o an ABI library entirely. This patch fixes building libc++ w/o an ABI library (and incorporates the `~type_info()` fix in D28211). The main changes in this patch are: 1) Add `-DLIBCXX_CXX_ABI=default` instead of using the empty string to mean "default". 2) Fix CMake bits which treated "none" as "default" on OS X. 3) Teach the source files to respect `-D_LIBCPP_BUILDING_HAS_NO_ABI_LIBRARY`. 4) Define ~type_info() when _LIBCPP_BUILDING_HAS_NO_ABI_LIBRARY is defined. Unfortunately this patch doesn't help clean up the macro mess that we use to configure for different ABI libraries. llvm-svn: 290849
* Revert r290839 - Fix configuring and building libc++ w/o an ABI libraryEric Fiselier2017-01-021-5/+1
| | | | llvm-svn: 290841
* Fix configuring and building libc++ w/o an ABI library.Eric Fiselier2017-01-021-1/+5
| | | | | | | | | | | | | | | | | | | Typically libc++ uses libc++abi or libcxxrt to provide the ABI and runtime bits of the C++ STL. However we also support building w/o an ABI library entirely. This patch fixes building libc++ w/o an ABI library (and incorporates the `~type_info()` fix in D28211). The main changes in this patch are: 1) Add `-DLIBCXX_CXX_ABI=default` instead of using the empty string to mean "default". 2) Fix CMake bits which treated "none" as "default" on OS X. 3) Teach the source files to respect `-D_LIBCPP_BUILDING_HAS_NO_ABI_LIBRARY`. 4) Define ~type_info() when _LIBCPP_BUILDING_HAS_NO_ABI_LIBRARY is defined. Unfortunately this patch doesn't help clean up the macro mess that we use to configure for different ABI libraries. llvm-svn: 290839
* [libcxx][CMake] Move the warning to HandleOutOfTreeLLVMPetr Hosek2016-12-121-0/+4
| | | | | | | | This currently gives a warning when building libcxx under runtimes. Differential Revision: https://reviews.llvm.org/D27643 llvm-svn: 289418
* Put C++ ABI headers in a special build directory instead of the top level.Eric Fiselier2016-12-091-6/+8
| | | | | | | | | | | | | | This patch changes where the C++ ABI headers are put during the build. Previously they were put in the top level include directory (not the libc++ header directory). However that just polutes the top level directory. Instead this patch creates a special directory to put them in. The reason they can't be put under c++/v1 until after the build is because libc++ uses the in-source headers, so we can't add the include path of the libc++ headers in the object dir. Additionally this patch teaches the test suite how to find the ABI headers, and adds a demangling utility to help debug tests with. llvm-svn: 289195
* Add check-cxx-abilist target when supported.Eric Fiselier2016-11-141-36/+25
| | | | | | | | | | | | | This patch adds a `check-cxx-abilist` target which verifies the libc++.so ABI when the current build configuration matches the configuration used to generate the ABI lists. In order to make this change `HandleOutOfTreeLLVM.cmake` needed to be modified to include `LLVMConfig.cmake` so that `TARGET_TRIPLE` is defined. Hopefully the changes needed to accommodate this won't break existing build configurations. llvm-svn: 286789
* [cmake] Allow testing against installed LLVM with no sourcesMichal Gorny2016-10-191-11/+6
| | | | | | | | | | | | Adjust the stand-alone build files to accept either CMake files from LLVM_CMAKE_PATH or from LLVM_MAIN_SRC_DIR instead of requiring both. This makes it possible to run libcxx tests on top of installed LLVM and lit, without having to unpack a copy of LLVM sources. Furthermore, it avoids adding duplicate paths. Differential Revision: https://reviews.llvm.org/D25093 llvm-svn: 284583
* Remove dead CMake targetEric Fiselier2016-10-141-2/+0
| | | | llvm-svn: 284216
* Cleanup CMake status outputEric Fiselier2016-10-101-3/+0
| | | | llvm-svn: 283721
* Fix linker script generation for in-tree buildsEric Fiselier2016-10-091-0/+8
| | | | llvm-svn: 283700
* [CMake] NFC. Missed the other uses in r280406Chris Bieneman2016-09-011-2/+2
| | | | | | Doh! Obviously need to slow down. llvm-svn: 280407
* [CMake] Don't copy headers on fully standaloneChris Bieneman2016-09-011-1/+9
| | | | | | | | In r280108 I tried to make the headers copy relative to LLVM_BINARY_DIR, and the intent was that it would only happen on in-tree builds or runtimes directory builds. It didn't actually work that way. This patch adds a check for CMAKE_SOURCE_DIR being equal to CMAKE_CURRENT_SOURCE_DIR. In this case we set a variable LIBCXX_USING_INSTLLED_LLVM. This doesn't necessarily mean the LLVM is installed (it could be a build directory), but it means we need to treat the LLVM directory as read-only. llvm-svn: 280400
* Fix libc++ configuration with -fsanitize-coverageIvan Krasin2016-09-011-0/+3
| | | | | | | | | | | | | | | | | | Summary: a recent change (r280015) in libc++ configuration broke LibFuzzer bot: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fuzzer/builds/12245 It's not restricted just to that bot; any code that uses the sanitize coverage and configures libc++ hits it. This CL fixes the issue. Reviewers: compnerd Subscribers: aizatsky Differential Revision: https://reviews.llvm.org/D24116 llvm-svn: 280335
* libc++: perform configuration checks with -nodefaultlibsSaleem Abdulrasool2016-08-291-1/+4
| | | | | | | | | | | | | | | | | | We're compiling libc++ with -nodefaultlibs, so we should also pass this option during the configuration checks to ensure those checks are consistent with the actual build. The primary motivation here is to ease cross-compilation against a non-standard set of C++ libraries. Previously, the configuration checks would attempt to link against the standard C++ libraries, which would cause link failures when cross-compiling, even though the actual library link would go through correctly (because of the use of -nodefaultlibs and explicitly specifying any needed libraries). This is more correct even ignoring the motivation, however. Patch by Shoaib Meenai! llvm-svn: 280015
* [CMake] Get libcxx building under LLVM/runtimesChris Bieneman2016-08-181-6/+8
| | | | | | | | | | | | | | | | | | | | | Summary: The new LLVM runtimes build directory requires some basic conventions across the runtime projects. These changes make libcxx build under the runtimes subdirectory. The general idea of the changes is that the runtimes subdirectory requires some conventions to be consistent across runtime projects. I expect to have a few more small patches that build on this to tie up check targets and other things useful in development workflows. Summary of changes in this patch: * Renamed variable LLVM_CONFIG -> LLVM_CONFIG_PATH * Renamed variable LIBCXX_BUILT_STANDALONE -> LIBCXX_STANDALONE_BUILD * Add an include of AddLLVM in the tests subdirectory for add_lit_testsuite. Reviewers: EricWF Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D23696 llvm-svn: 279151
* Rework libatomic handling in CMake and LIT.Eric Fiselier2016-07-181-1/+1
| | | | | | | | | | | | | | | This patch updates the way libc++ handles checking for libatomic, in part to prepare for https://reviews.llvm.org/D22073. Changes: * 'LIBCXX_HAS_ATOMIC_LIB' is now set whenever libatomic is available even libc++ doesn't need to manually link it. * 'LIBCXX_HAVE_CXX_ATOMICS_WITH_LIB' is now used to detect when libatomic needs to be manually linked. * 'LIBCXX_HAS_ATOMIC_LIB' now adds 'libatomic' as a available feature in the test suite. llvm-svn: 275759
* [CMake] Cleanup uses of USES_TERMINALChris Bieneman2016-06-081-8/+0
| | | | | | | | Now that we are on CMake 3.4.3 we no longer need a version check around this. This is the libcxx side of r272211. llvm-svn: 272212
* [libcxx] Allow target flags to affect CMake configuration testsEric Fiselier2016-06-021-0/+20
| | | | | | | | | | | | | | | | | | Summary: This patch changes the libc++ CMake so that it adds certain target flags like '-m32' or '--gcc-toolchain' before including config-ix.cmake. Since these flags can affect things like check_library_exists([...]) they needed to be added before the tests are performed. This patch fixes: https://llvm.org/bugs/show_bug.cgi?id=24322 Reviewers: danalbert, jroelofs, bcraig, compnerd Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D20887 llvm-svn: 271460
* Fix PR27875. Parse LIBCXX_CXX_ABI_LIBRARY_PATH as a path not a stringEric Fiselier2016-05-271-2/+4
| | | | llvm-svn: 271070
* [libcxx] Prefer C++14 over C++11 when building libc++experimental.Eric Fiselier2016-05-101-0/+5
| | | | | | | | | | | | | | | | | | Summary: Currently libc++experimental builds with C++11. This patch changes that to C++14 when supported by the compiler. Although nothing currently requires C++14 the upcoming <experimental/memory_resource> implementation would benefit from it. [1] Note that libc++.so continues to build with C++11 and is unaffected by this change. [1] <experimental/memory_resource> provides global resources which must exist for the entire lifetime of the program. In order to ensure that a global resource can be used during program termination there destructors must never be invoked. The only way to do this, while also allowing "constant initialization", is to use a C++14 union. Reviewers: mclow.lists Subscribers: pete, cfe-commits Differential Revision: http://reviews.llvm.org/D19992 llvm-svn: 269070
* Fix PR26622 - Make CheckLibcxxAtomic.cmake use the libc++ headers.Eric Fiselier2016-02-201-2/+2
| | | | llvm-svn: 261383
* Issue a warning instead of fatal errors when checks for libatomic fail.Vasileios Kalintiris2016-02-161-2/+2
| | | | | | | | | | | | This should fix PR26631, PR26622 and has the nice property that the addition of the CheckLibcxxAtomic.cmake module acts as an NFC on the platforms of the reporters (at least for the time being). As these bug reports explain, CMake fails the atomic check because the include headers might not exist in the host environment. We could potentially point to the headers provided by libcxx itself. llvm-svn: 260961
* Rename CheckLibcxxAtomic.cmake variable result names so they don't clash ↵Eric Fiselier2016-02-111-2/+2
| | | | | | with LLVM llvm-svn: 260531
* Fix r260515 - Correct typos in CMake changesEric Fiselier2016-02-111-4/+4
| | | | llvm-svn: 260524
* Re-commit "Introduce a cmake module to figure out whether we need to link ↵Vasileios Kalintiris2016-02-111-0/+41
| | | | | | | | | | with libatomic." This re-applies commit r260235. However, this time we add -gcc-toolchain to the compiler's flags when the user has specified the LIBCXX_GCC_TOOLCHAIN variable. llvm-svn: 260515
* Revert "Introduce a cmake module to figure out whether we need to link with ↵Vasileios Kalintiris2016-02-091-38/+0
| | | | | | | | | | | libatomic." This reverts commit r260235. It breaks LLVM's bootstrap when building with a -gcc-toolchain and the system's gcc installation does not provide the libatomic library and its headers. We should check whether LIBCXX_GCC_TOOLCHAIN is set and adjust the flags accordingly. llvm-svn: 260323
* Introduce a cmake module to figure out whether we need to link with libatomic.Vasileios Kalintiris2016-02-091-0/+38
| | | | | | | | | | | | | | Summary: This fixes the tests under std/atomics for 32-bit MIPS CPUs where the 8-byte atomic operations call into the libatomic library. Reviewers: dsanders, mclow.lists, EricWF, jroelofs, joerg Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D16613 llvm-svn: 260235
* Fix the search path for CMake filesNiels Ole Salscheider2016-02-041-1/+1
| | | | | | | This allows to find the LLVM's CMake files after moving them in r259821. llvm-svn: 259842
* Revert r256606 due to compiler-rt sanitizer bot failuresEric Fiselier2015-12-301-31/+10
| | | | llvm-svn: 256614
* Cleanup CMake for out-of-tree buildsEric Fiselier2015-12-301-10/+31
| | | | llvm-svn: 256606
* Only disable linker script when LIBCXX_CXX_ABI_LIBNAME is noneEric Fiselier2015-10-221-13/+0
| | | | llvm-svn: 251063
* [libcxx] Make libc++.so a linker script by default on most platforms.Eric Fiselier2015-10-151-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch turns on `LIBCXX_ENABLE_ABI_LINKER_SCRIPT` by default whenever `LLVM_HAVE_LINK_VERSION_SCRIPT` is ON. This turns out to be whenever: 1. WIN32 is not defined. 2 UNIX is defined. 3. APPLE is not defined. While `LLVM_HAVE_LINK_VERSION_SCRIPT` is meant to reflect exactly what we are asking I think it's close enough. After committing this patch Linux users will no longer have to use "-lc++abi" explicitly! Reviewers: mclow.lists, danalbert, compnerd, jroelofs Subscribers: emaste, rengolin, cbergstrom, cfe-commits Differential Revision: http://reviews.llvm.org/D13739 llvm-svn: 250469
* Use __config_site when building libc++. Also cleanup ABI versioning docEric Fiselier2015-10-141-3/+3
| | | | llvm-svn: 250261
* ABI versioning macros for libc++.Evgeniy Stepanov2015-10-131-0/+6
| | | | | | | | C++ macros and CMake options that specify the default ABI version of the library, and can be overridden to pick up new ABI-changing features. llvm-svn: 250254
* [libcxx] Capture configuration information when installing the libc++ headersEric Fiselier2015-10-131-0/+16
| | | | | | | | | | | | | | | | | Summary: Hi all, This patch is a successor to D11963. However it has changed dramatically and I felt it would be best to start a new review thread. Please read the design documentation added in this patch for a description of how it works. Reviewers: mclow.lists, danalbert, jroelofs, EricWF Subscribers: vkalintiris, rnk, ed, espositofulvio, asl, eugenis, cfe-commits Differential Revision: http://reviews.llvm.org/D13407 llvm-svn: 250235
* [libcxx] Remove installation rules on Darwin when it would overwrite the ↵Eric Fiselier2015-08-261-5/+7
| | | | | | | | | | | | | | | | | system installation. Summary: On Mac OS X overwriting `/usr/lib/libc++.dylib` can cause your computer to fail to boot. This patch tries to make it harder to do that accidentally. If `CMAKE_SYSTEM_NAME` is `Darwin` and `CMAKE_INSTALL_PREFIX` is `/usr` don't generate installation rules unless the user explicitly provides `LIBCXX_OVERRIDE_DARWIN_INSTALL=ON`. Note that `CMAKE_INSTALL_PREFIX` is always absolute so we don't need to worry about things like `/usr/../usr`. Reviewers: mclow.lists, beanz, jroelofs Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D12209 llvm-svn: 246070
* Fix default value for LLVM_INCLUDE_DOCS in out of tree build.Eric Fiselier2015-08-221-0/+3
| | | | llvm-svn: 245790
* [libcxx] Add new Sphinx documentationEric Fiselier2015-08-221-0/+11
| | | | | | | | | | | | | | | | | Summary: This patch adds Sphinx based documentation to libc++. The goal is to make it easier to write documentation for libc++ since writing new documentation in HTML is cumbersome. This patch rewrites the main page for libc++ along with the instructions for using, building and testing libc++. The built documentation can be found and reviewed here: http://efcs.ca/libcxx-docs In order to build the sphinx documentation you need to specify the cmake options `-DLLVM_ENABLE_SPHINX=ON -DLIBCXX_INCLUDE_DOCS=ON`. This will add the makefile rule `docs-libcxx-html`. Reviewers: chandlerc, mclow.lists, danalbert, jroelofs Subscribers: silvas, cfe-commits Differential Revision: http://reviews.llvm.org/D12129 llvm-svn: 245788
* [libcxx] Add "install-libcxx" target.Eric Fiselier2015-08-191-0/+1
| | | | | | | | | | | | Summary: Currently you can't install libc++ from within the LLVM tree without installing all of LLVM. This patch adds an install rule for libc++. Reviewers: mclow.lists, danalbert, jroelofs, EricWF Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D11697 llvm-svn: 245470
* Fix CMake error whet llvm-config reports a non-existent source directory.Eric Fiselier2015-08-121-2/+6
| | | | llvm-svn: 244717
* Remove -Werror when using check_cxx_compiler_flag because it was causing ↵Eric Fiselier2015-07-311-1/+1
| | | | | | compiler-rt breakages. llvm-svn: 243784
OpenPOWER on IntegriCloud