Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
COMP: fix build with -std=c++11 when ITK/VXL initially configured wit…
…hout SimpleITK forces the compiler option '-std=c++11' when built against libc++, such as is the case with Mac OS 10.9 or higher. However, by default Slicer (and ITK) are not configured to use C++11. Thus when SimpleITK is built against a non-'std=c++11' ITK build, there is a mismatch between `VCL_CONSTEXPR` and the `VCL_CAN_STATIC_CONST_INIT_*` preprocessor options, leading to compiler errors in Slicer and on the SimpleITK dashboard [1,2]. Specifically, for '-std=c++11' compiler, `VCL_CONSTEXPR = constexpr` as introduced in [3], but `VCL_CAN_STATIC_CONST_INIT_{FLOAT,INT}` is undefined, leading to `VCL_STATIC_CONST_INIT_FLOAT_DECL = ""` leading to preprocessed definitions for VNL traits such as: ``` template <> class vnl_numeric_traits<float> ... static constexpr float zero ; ``` This causes the mentioned build errors because `constexpr` expressions must be immediately constructible. The proposed patch unifies these options so that they agree when VXL is compiled under '-std=c++11'. [1] http://slicer-devel.65872.n3.nabble.com/build-error-in-simpleitk-td4035854.html [2] https://open.cdash.org/buildSummary.php?buildid=4170100 [3] http://review.source.kitware.com/#/c/20386/ Change-Id: If04f4d3d0483fd8186e5a1189d183a9f0bb200d8
- Loading branch information