summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeoffrey Malcolm Oxberry <goxberry@gmail.com>2018-01-16 03:34:41 -0800
committerscheibelp <scheibel1@llnl.gov>2018-01-19 13:44:36 -0800
commit7c4c6e72ad55d5618e90ab831a93e7d2553bb8c5 (patch)
tree228de2020ff3121478aad046165ca7566463c728
parent48ae4c22b24d04ed4004dababde53d37c931adf7 (diff)
downloadspack-7c4c6e72ad55d5618e90ab831a93e7d2553bb8c5.tar.gz
spack-7c4c6e72ad55d5618e90ab831a93e7d2553bb8c5.tar.bz2
spack-7c4c6e72ad55d5618e90ab831a93e7d2553bb8c5.tar.xz
spack-7c4c6e72ad55d5618e90ab831a93e7d2553bb8c5.zip
vtk@:6.1.0 : disable Obj-C gc for XCode >= 5.1
Apple removed support for Objective-C garbage collection in binaries in XCode 5.1, but VTK 6.1.0 and earlier set flags for garbage collection, resulting in a compile-time bug when compiling VTK using any recent version of XCode (i.e., Apple Clang). This commit fixes this bug by removing the garbage collection flags via setting the variable `VTK_REQUIRED_OBJCXX_FLAGS` to the empty string. This variable has the same value (i.e., the empty string) in the root-level CMakeLists.txt file for VTK 6.2.0 and later.
-rw-r--r--var/spack/repos/builtin/packages/vtk/package.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/vtk/package.py b/var/spack/repos/builtin/packages/vtk/package.py
index bce6cc2475..caf11b1fc7 100644
--- a/var/spack/repos/builtin/packages/vtk/package.py
+++ b/var/spack/repos/builtin/packages/vtk/package.py
@@ -114,4 +114,16 @@ class Vtk(CMakePackage):
'-DNETCDF_CXX_LIBRARY={0}'.format(netcdf_cxx_lib),
])
+ # Garbage collection is unsupported in Xcode starting with
+ # version 5.1; if the Apple clang version of the compiler
+ # is 5.1.0 or later, unset the required Objective-C flags
+ # to remove the garbage collection flags. Versions of VTK
+ # after 6.1.0 set VTK_REQUIRED_OBJCXX_FLAGS to the empty
+ # string. This fix was recommended on the VTK mailing list
+ # in March 2014 (see
+ # https://public.kitware.com/pipermail/vtkusers/2014-March/083368.html)
+ if (self.compiler.is_apple and
+ self.compiler.version >= Version('5.1.0')):
+ cmake_args.extend(['-DVTK_REQUIRED_OBJCXX_FLAGS=""'])
+
return cmake_args