summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChuck Atkins <chuck.atkins@kitware.com>2019-01-30 21:24:20 -0500
committerPeter Scheibel <scheibel1@llnl.gov>2019-01-30 20:24:20 -0600
commitbe38fded9b600bafa736da2b413edf5ae7c6fed0 (patch)
tree8c633a6fb6ee2e0946021131ebf0642e59c3aa4c
parent2b6bf06150a6c108e0a59de9b37f00eb1cc2853e (diff)
downloadspack-be38fded9b600bafa736da2b413edf5ae7c6fed0.tar.gz
spack-be38fded9b600bafa736da2b413edf5ae7c6fed0.tar.bz2
spack-be38fded9b600bafa736da2b413edf5ae7c6fed0.tar.xz
spack-be38fded9b600bafa736da2b413edf5ae7c6fed0.zip
cmake: Fix linker errors on Darwin when using external dependencies (#10467)
Adds upstream patch for a missing framework. This is anticipated to be fixed by CMake 3.13.4 so is only applied up to version 3.13.3
-rw-r--r--var/spack/repos/builtin/packages/cmake/cmake-macos-add-coreservices.patch28
-rw-r--r--var/spack/repos/builtin/packages/cmake/package.py5
2 files changed, 33 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/cmake/cmake-macos-add-coreservices.patch b/var/spack/repos/builtin/packages/cmake/cmake-macos-add-coreservices.patch
new file mode 100644
index 0000000000..62e7244e3e
--- /dev/null
+++ b/var/spack/repos/builtin/packages/cmake/cmake-macos-add-coreservices.patch
@@ -0,0 +1,28 @@
+commit 475e78d9071b34690617a85853433a9fc15da057
+Author: Chuck Atkins <chuck.atkins@kitware.com>
+Date: Mon Jan 28 16:28:28 2019 -0500
+
+ macOS: Add missing explicit dependency on CoreServices framework
+
+ On Apple, the implementation of cmGlobalXCodeGenerator::Open uses
+ LSOpenCFURLRef from CoreServices. This get's transitively pulled in
+ from CMake's libuv build but ends up generating a linker error when
+ using an external libuv. This explicitly adds the appropriate
+ dependency.
+
+diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
+index 311f3f4e56..8aff8f6b2f 100644
+--- a/Source/CMakeLists.txt
++++ b/Source/CMakeLists.txt
+@@ -791,9 +791,10 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_SYSTEM_PROCESSOR MATCHES "sparc"
+ endif()
+ endif()
+
+-# On Apple we need CoreFoundation
++# On Apple we need CoreFoundation and CoreServices
+ if(APPLE)
+ target_link_libraries(CMakeLib "-framework CoreFoundation")
++ target_link_libraries(CMakeLib "-framework CoreServices")
+ endif()
+
+ if(WIN32 AND NOT UNIX)
diff --git a/var/spack/repos/builtin/packages/cmake/package.py b/var/spack/repos/builtin/packages/cmake/package.py
index 3e375354e7..5aa68ef97f 100644
--- a/var/spack/repos/builtin/packages/cmake/package.py
+++ b/var/spack/repos/builtin/packages/cmake/package.py
@@ -11,6 +11,7 @@ class Cmake(Package):
tools designed to build, test and package software."""
homepage = 'https://www.cmake.org'
url = 'https://github.com/Kitware/CMake/releases/download/v3.13.0/cmake-3.13.0.tar.gz'
+ maintainers = ['chuckatkins']
version('3.13.3', '665f905036b1f731a2a16f83fb298b1fb9d0f98c382625d023097151ad016b25')
version('3.13.2', 'c925e7d2c5ba511a69f43543ed7b4182a7d446c274c7480d0e42cd933076ae25')
@@ -50,6 +51,10 @@ class Cmake(Package):
version('3.0.2', 'db4c687a31444a929d2fdc36c4dfb95f')
version('2.8.10.2', '097278785da7182ec0aea8769d06860c')
+ # Fix linker error when using external libs on darwin.
+ # See https://gitlab.kitware.com/cmake/cmake/merge_requests/2873
+ patch('cmake-macos-add-coreservices.patch', when='@3.11.0:3.13.3')
+
variant('ownlibs', default=False, description='Use CMake-provided third-party libraries')
variant('qt', default=False, description='Enables the build of cmake-gui')
variant('doc', default=False, description='Enables the generation of html and man page documentation')