summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDr. Christian Tacke <58549698+ChristianTackeGSI@users.noreply.github.com>2020-03-06 19:16:30 +0100
committerGitHub <noreply@github.com>2020-03-06 12:16:30 -0600
commitce287bccf8718f2ff5a9cb92c5967ebdac12363b (patch)
treec1e6d1738ce5dceb410e901096648064cd5555f0
parent6412b9e71a74d148af0a297faaeaace7683b414a (diff)
downloadspack-ce287bccf8718f2ff5a9cb92c5967ebdac12363b.tar.gz
spack-ce287bccf8718f2ff5a9cb92c5967ebdac12363b.tar.bz2
spack-ce287bccf8718f2ff5a9cb92c5967ebdac12363b.tar.xz
spack-ce287bccf8718f2ff5a9cb92c5967ebdac12363b.zip
flatbuffers: Allow building shared libraries (#15375)
Added a shared variant, that switches between shared and static library building, like with most cmake packages.
-rw-r--r--var/spack/repos/builtin/packages/flatbuffers/package.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/flatbuffers/package.py b/var/spack/repos/builtin/packages/flatbuffers/package.py
index 538922a7de..72ad2e599c 100644
--- a/var/spack/repos/builtin/packages/flatbuffers/package.py
+++ b/var/spack/repos/builtin/packages/flatbuffers/package.py
@@ -17,3 +17,16 @@ class Flatbuffers(CMakePackage):
version('1.10.0', sha256='3714e3db8c51e43028e10ad7adffb9a36fc4aa5b1a363c2d0c4303dd1be59a7c')
version('1.9.0', sha256='5ca5491e4260cacae30f1a5786d109230db3f3a6e5a0eb45d0d0608293d247e3')
version('1.8.0', sha256='c45029c0a0f1a88d416af143e34de96b3091642722aa2d8c090916c6d1498c2e')
+
+ variant('shared', default=True,
+ description='Build shared instead of static libraries')
+
+ def cmake_args(self):
+ args = []
+ args.append('-DFLATBUFFERS_BUILD_SHAREDLIB={0}'.format(
+ 'ON' if '+shared' in self.spec else 'OFF'))
+ args.append('-DFLATBUFFERS_BUILD_FLATLIB={0}'.format(
+ 'ON' if '+shared' not in self.spec else 'OFF'))
+ if 'darwin' in self.spec.architecture:
+ args.append('-DCMAKE_MACOSX_RPATH=ON')
+ return args