Commit Graph

83 Commits

Author SHA1 Message Date
Louis Dionne
9bb400fc60 [CMake] Improve how we test against c++17
This will allow us to test against c++20 more easily.
2019-02-11 16:28:35 -05:00
Louis Dionne
224a968d15 [CMake] Add -Wno-self-assign-overloaded to the unit test flags 2019-02-11 16:16:37 -05:00
Zach Laine
7adb3f4b31 Rename check to hana_check
If a "check" target exists, give it a dependency on hana_check. Also, add a custom target check that depends on hana_check otherwise.

Closes  (#422)
2018-09-20 14:47:24 -04:00
Xiang Fan
95f8f74a2c Enable building boost.hana with VS2107 15.8 (with five source workarounds)
Here is the test result:

 100% tests passed, 0 tests failed out of 1103

Here are the details of the source workarounds:

 1. Active issues we are working on
 a. Multiple copy/move ctors
 VC doesn't correctly handle multiple copy/move ctors.
 The workaround is under macro BOOST_HANA_WORKAROUND_MSVC_MULTIPLECTOR_106654.

 b. Forward declaration of class template member function returning decltype(auto) (this issue is exposed by a recent change in boost 1.68)
 To deduce the actual return type, the compiler expects the function definition to be on the pending list for temploid, which isn't always the case when generic lambda is involved.
 The workaround is under macro BOOST_HANA_WORKAROUND_MSVC_DECLTYPEAUTO_RETURNTYPE_662735

 2. Issues fixed in the development branch of MSVC
 Parsing template id
 VC sometimes incorrectly parses a comparison operation as a template id.
 The workaround is under macro BOOST_HANA_WORKAROUND_MSVC_RDPARSER_TEMPLATEID_616568.

 3. Issues fixed conditionally
 a. Empty base optimization
 VC doesn't always do EBO (empty base optimization). Changing this will break the ABI of MSVC and we provide a __declspec(empty_bases) to enable EBO.
 We have a blog post on this: https://blogs.msdn.microsoft.com/vcblog/2016/03/30/optimizing-the-layout-of-empty-base-classes-in-vs2015-update-2-3/.
 Some tests in hana have static_assert on the size of certain types which relies on EBO being applied:

 hana\test\detail\ebo.cpp
 hana\test\issues\github_202.cpp
 hana\test\pair\empty_storage.cpp
 hana\test\tuple\empty_member.cpp

 The workaround is under macro BOOST_HANA_WORKAROUND_MSVC_EMPTYBASE.

 b. Variadic macro expansion
 The implementation of variadic macro isn't conformant and the macro expansion often results in incorrect result.
 The issue is fixed under /experimental:preprocessor and isn't on by default yet.
 We have a blog post on this: https://blogs.msdn.microsoft.com/vcblog/2018/07/06/msvc-preprocessor-progress-towards-conformance/.

 The workaround is under macro BOOST_HANA_WORKAROUND_MSVC_PREPROCESSOR_616033.

Here is the list of files impacted by the source workarounds:

 BOOST_HANA_WORKAROUND_MSVC_MULTIPLECTOR_106654
  hana\test\_include\laws\base.hpp
  hana\test\map\cnstr.trap.cpp
  hana\test\set\cnstr.trap.cpp
  hana\test\tuple\cnstr.trap.cpp

 BOOST_HANA_WORKAROUND_MSVC_DECLTYPEAUTO_RETURNTYPE_662735
  hana\test\_include\laws\euclidean_ring.hpp
  hana\test\_include\laws\group.hpp
  hana\test\_include\laws\monad_plus.hpp
  hana\test\_include\laws\monoid.hpp
  hana\test\_include\laws\ring.hpp

 BOOST_HANA_WORKAROUND_MSVC_RDPARSER_TEMPLATEID_616568
  hana\include\boost\hana\basic_tuple.hpp
  hana\include\boost\hana\string.hpp
  hana\include\boost\hana\tuple.hpp

 BOOST_HANA_WORKAROUND_MSVC_EMPTYBASE
  hana\include\boost\hana\basic_tuple.hpp
  hana\include\boost\hana\pair.hpp
  hana\include\boost\hana\tuple.hpp
  hana\include\boost\hana\detail\integral_constant.hpp
  hana\test\detail\ebo.cpp

 BOOST_HANA_WORKAROUND_MSVC_PREPROCESSOR_616033
  hana\include\boost\hana\detail\preprocessor.hpp
  hana\include\boost\hana\detail\struct_macros.hpp

BTW,
1. There are some warnings which I don't fix. I will likely address them in a separate PR. They look legit and don't impact the build and tests.
2. Appveyor currently doesn't provide 15.8 Preview 5 which contains all the compiler fixes we made in the previous months. I plan to update appveyor.yml after Appveyor provides 15.8 RTM.
2018-08-22 16:59:34 -07:00
Louis Dionne
74dea58a6e Bump minimum Boost version to 1.63 and test against 1.66.0 2018-01-25 15:30:13 -08:00
Louis Dionne
af5a9c5ee2 [CMake] Give the 'check' target access to the terminal
This allows outputing CTest results as the tests are being run, as opposed
to all at once at the end.
2017-11-26 14:18:07 -08:00
Louis Dionne
df7ce357f6 [Travis] Test against Boost 1.65.1 and drop versions older than 1.63
This reduces the load on Travis. Since we don't advertise anywhere that Hana
works with older versions of Boost, if this ends up breaking someone (because
they're mixing Hana and Boost at different versions and we introduce a change
that breaks under some older Boost), it can be argued that it's their problem.
2017-11-25 13:59:19 -08:00
Louis Dionne
a5d1ffb0c4 [CMake] Update required version of CMake to 3.9 2017-11-25 13:59:19 -08:00
Louis Dionne
b88ce8d54f [CMake] Refactor how we set the include path in HanaConfig.cmake 2017-11-25 13:12:12 -08:00
Louis Dionne
d75ed374ce [CMake] Add an option to use -std=c++17 2017-07-22 10:55:38 -07:00
Louis Dionne
dad5d41cfe [NFC] Fix typo in CMake comment 2017-07-22 10:12:03 -07:00
Louis Dionne
f59bd152df [CMake] Reintroduce workaround for -std=c++14 on Clang/Windows 2017-06-24 15:05:36 -07:00
Louis Dionne
d1ea99a84e [CMake] Properly quote file paths 2017-06-24 14:53:10 -07:00
Louis Dionne
8bddcd9b7f Move to CMake 3.8 2017-06-24 14:53:10 -07:00
Louis Dionne
8b39270d61 [CMake] Properly install HanaConfig.cmake in lib/cmake/hana
Thanks @pfultz2 for teaching me how to use CMake properly :-)
2017-03-30 21:15:53 -07:00
Louis Dionne
a0a8ecc061 [CMake] Do not include Boost headers globally 2017-03-29 22:08:04 -07:00
Louis Dionne
d53ef246fd Generate a HanaConfig file that exports the Hana target
This supersedes the `FindHana.cmake` module that we used to provide, which was
buggy and was not the proper way of giving an easy integration for CMake users.

Fixes #328
2017-03-29 21:41:07 -07:00
Louis Dionne
17fe66751f [CMake] Remove useless check on Clang for Windows 2017-02-28 09:22:20 -10:00
Louis Dionne
02afb37830 [experimental] Move experimental/ to example/misc, and do some cleanup 2017-02-18 12:43:30 -08:00
Louis Dionne
50336d4aeb [CMake] Use per-target properties instead of populating global flags 2017-02-10 08:07:44 -08:00
Louis Dionne
478b5cc690 [CMake] Handle Valgrind through CTest, without a custom boost_hana_add_test 2017-02-08 07:57:13 -08:00
Louis Dionne
9895803ede Bump copyright year to 2017 2017-01-07 14:14:18 -08:00
Louis Dionne
8f8794fd28 [CMake] Add the hana interface library
Also, simplify the example/test setup by removing the tests.quick target
2016-10-10 20:52:54 -07:00
Louis Dionne
c642a9a78d [CMake] Use -fdiagnostics-color when available 2016-01-28 12:54:29 -05:00
Louis Dionne
67ec8b2867 [CMake] Add a pkg-config file
Closes #237
2016-01-26 12:02:41 -05:00
Louis Dionne
73c7ec7cb8 [CMake] Parse the version from <boost/hana/version.hpp> 2016-01-26 11:24:10 -05:00
Louis Dionne
7e04b36268 Add BOOST_HANA_ENABLE_DEBUG_MODE and optional checks in make_set and make_map
Closes #230
2016-01-06 09:25:41 -05:00
Louis Dionne
1026267959 [CMake] Modularize the checks for external packages 2016-01-04 14:58:11 -05:00
Louis Dionne
c41a5cb6be Update copyright notices for 2016 2016-01-01 14:54:06 -05:00
Louis Dionne
fb3a6fb52f Drop support for Boost 1.57 and 1.58 2015-12-16 11:55:24 -05:00
Louis Dionne
66b614e2f4 [CMake] Look for Boost >= 1.57.0 2015-12-16 09:04:44 -05:00
m-j-w
87c036bc64 [Clang-cl] Compiler detection for LLVM/Clang-cl with Visual Studio integration
[ldionne: Minor reindentation, add space between < operator]

Closes #203
2015-11-15 15:15:12 -05:00
Louis Dionne
4782c8a0b6 [CMake] Simplify and optimize the handling of unit tests and examples 2015-11-14 14:13:27 -05:00
Louis Dionne
fbb6c4fd4d [CMake/Doc] Add the 'install' target and document how to install Hana
Also remove the 'check' target from 'all', because otherwise 'check'
is run before 'install'.
2015-10-29 13:34:34 -04:00
Louis Dionne
cff7039ab3 [CMake/Travis] Simplify CMake setup by moving benchmark and doc uploads to Travis
The benchmarks/documentation were only ever updated from Travis, and it
is much simpler to do it directly in bash from Travis than to write it
in CMake as we did.
2015-10-04 16:48:38 -04:00
Louis Dionne
a5714d5628 [CMake] Fix conditional messed up by ac9b75d 2015-09-20 08:01:50 -07:00
Louis Dionne
ac9b75dd5a [CMake] Do not use -Wno-gnu-string-xxx on GCC 2015-09-17 16:31:18 -04:00
Louis Dionne
c9784816f4 Move /test/sandbox to /experimental
Closes #169
2015-09-16 12:48:09 -04:00
Louis Dionne
e5c74e5a91 [CMake] Remove unused CMakeDependentOption module 2015-09-12 17:59:57 -04:00
Louis Dionne
5d02750150 Improve diagnostics for supported compilers and standard libraries
Closes #172
Closes #168
2015-09-08 08:25:07 -04:00
Louis Dionne
be5a787741 [CMake][Travis] Add support for building without exceptions
Also, swap the project() and the cmake_minimum_required() commands
in the top-level CMake file, as this silences a warning when building
on Cygwin. See #168.
2015-09-07 23:19:31 -04:00
Louis Dionne
ed2eca2ddb [Doc] Document hana::string instead of hana::String 2015-08-30 17:07:19 -04:00
Louis Dionne
1e89c69049 [CMake] Remove LIBCXX_ROOT cruft and properly explain the situation in the README
Also:
- Remove the boost_hana_add_executable function, which is now useless
- Properly set the LD_LIBRARY_PATH to link against a custom libc++
- Adjust the Travis build

Fixes #135
2015-06-24 20:07:13 -04:00
Louis Dionne
41c9d6e032 [CMake] Switch BOOST_HANA_ENABLE_LIBCXX to OFF by default
No -stdlib=libc++ is usually the right behavior

Fixes #135
2015-06-17 22:04:57 -04:00
Louis Dionne
350f68c523 [Travis] Add a job testing without the concept checks 2015-06-12 17:30:37 -04:00
Louis Dionne
0cbf6082c2 Add a "Try it online" link and a script to upload the library to Wandbox
Thanks a __lot__ to the people behind Wandbox for all the help!
This is related to https://github.com/melpon/wandbox/issues/153.

Closes #87
2015-06-11 20:39:35 -04:00
Louis Dionne
8c1e68f107 [CMake] Remove old -Xclang -fdefine-sized-deallocation flag 2015-06-02 23:53:03 -04:00
Louis Dionne
efdd5c46ed [CMake] Remove unused warning flags 2015-06-02 14:45:40 -04:00
Louis Dionne
a32de51bfa [String] Add an optional _s user-defined literal to create Strings
Fixes #79
2015-06-02 14:45:38 -04:00
Louis Dionne
647e695951 [CMake] Add the check target and fix minor annoyances 2015-05-30 12:23:01 -04:00