summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMassimiliano Culpo <massimiliano.culpo@googlemail.com>2017-01-15 11:34:15 +0100
committerTodd Gamblin <tgamblin@llnl.gov>2017-01-15 02:34:15 -0800
commit436f6a4ab65943645c68f82691c9ccd234c43d51 (patch)
tree99a2ea3fe98ac264cde69d7f02c7ca05271c712c /lib
parent957cb968c619e32fc764babb8dc8ed977b42c789 (diff)
downloadspack-436f6a4ab65943645c68f82691c9ccd234c43d51.tar.gz
spack-436f6a4ab65943645c68f82691c9ccd234c43d51.tar.bz2
spack-436f6a4ab65943645c68f82691c9ccd234c43d51.tar.xz
spack-436f6a4ab65943645c68f82691c9ccd234c43d51.zip
get_std_cmake_args delegates to CMakePackage._std_args fixes #2665 (#2805)
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/build_environment.py22
-rw-r--r--lib/spack/spack/test/build_systems.py42
2 files changed, 51 insertions, 13 deletions
diff --git a/lib/spack/spack/build_environment.py b/lib/spack/spack/build_environment.py
index 7046c81c2f..3e6dc12b35 100644
--- a/lib/spack/spack/build_environment.py
+++ b/lib/spack/spack/build_environment.py
@@ -432,19 +432,15 @@ def get_rpaths(pkg):
return rpaths
-def get_std_cmake_args(cmake_pkg):
- # standard CMake arguments
- ret = ['-DCMAKE_INSTALL_PREFIX=%s' % cmake_pkg.prefix,
- '-DCMAKE_BUILD_TYPE=RelWithDebInfo',
- '-DCMAKE_VERBOSE_MAKEFILE=ON']
- if platform.mac_ver()[0]:
- ret.append('-DCMAKE_FIND_FRAMEWORK=LAST')
-
- # Set up CMake rpath
- ret.append('-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=FALSE')
- ret.append('-DCMAKE_INSTALL_RPATH=%s' % ":".join(get_rpaths(cmake_pkg)))
-
- return ret
+def get_std_cmake_args(pkg):
+ """Returns the list of standard arguments that would be used if this
+ package was a CMakePackage instance.
+
+ :param pkg: pkg under consideration
+
+ :return: list of arguments for cmake
+ """
+ return spack.CMakePackage._std_args(pkg)
def parent_class_modules(cls):
diff --git a/lib/spack/spack/test/build_systems.py b/lib/spack/spack/test/build_systems.py
new file mode 100644
index 0000000000..2cafba0333
--- /dev/null
+++ b/lib/spack/spack/test/build_systems.py
@@ -0,0 +1,42 @@
+##############################################################################
+# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
+# Produced at the Lawrence Livermore National Laboratory.
+#
+# This file is part of Spack.
+# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
+# LLNL-CODE-647188
+#
+# For details, see https://github.com/llnl/spack
+# Please also see the LICENSE file for our notice and the LGPL.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License (as
+# published by the Free Software Foundation) version 2.1, February 1999.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
+# conditions of the GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##############################################################################
+
+import spack
+from spack.build_environment import get_std_cmake_args
+from spack.spec import Spec
+
+
+def test_cmake_std_args(config, builtin_mock):
+ # Call the function on a CMakePackage instance
+ s = Spec('cmake-client')
+ s.concretize()
+ pkg = spack.repo.get(s)
+ assert pkg.std_cmake_args == get_std_cmake_args(pkg)
+
+ # Call it on another kind of package
+ s = Spec('mpich')
+ s.concretize()
+ pkg = spack.repo.get(s)
+ assert get_std_cmake_args(pkg)