Skip to content

Commit 0b8cb89

Browse files
committed
Allow building of static binaries
1 parent 0da5ebb commit 0b8cb89

File tree

2 files changed

+44
-6
lines changed

2 files changed

+44
-6
lines changed

config/meson.build

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,43 @@ else
103103
endif
104104

105105
# Create the tool chain library as subproject
106-
mctc_dep = dependency('mctc-lib', fallback: ['mctc-lib', 'mctc_dep'])
106+
mctc_dep = dependency('mctc-lib', required: false)
107+
if not mctc_dep.found()
108+
mctc_prj = subproject(
109+
'mctc-lib',
110+
version: '>=0.2',
111+
default_options: [
112+
'default_library=static',
113+
],
114+
)
115+
mctc_dep = mctc_prj.get_variable('mctc_dep')
116+
117+
if install
118+
install_data(
119+
mctc_prj.get_variable('mctc_lic'),
120+
install_dir: get_option('datadir')/'licenses'/meson.project_name()/'mctc-lib'
121+
)
122+
endif
123+
endif
107124
lib_deps += mctc_dep
108125

109-
# Create the electronegativity equilibration library as subproject
110-
multicharge_dep = dependency('multicharge', fallback: ['multicharge', 'multicharge_dep'])
126+
# Create the tool chain library as subproject
127+
multicharge_dep = dependency('multicharge', required: false)
128+
if not multicharge_dep.found()
129+
multicharge_prj = subproject(
130+
'multicharge',
131+
version: '>=0.1',
132+
default_options: [
133+
'default_library=static',
134+
],
135+
)
136+
multicharge_dep = multicharge_prj.get_variable('multicharge_dep')
137+
138+
if install
139+
install_data(
140+
multicharge_prj.get_variable('multicharge_lic'),
141+
install_dir: get_option('datadir')/'licenses'/meson.project_name()/'multicharge'
142+
)
143+
endif
144+
endif
111145
lib_deps += multicharge_dep

test/unit/meson.build

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,19 @@
1515
# along with dftd4. If not, see <https://www.gnu.org/licenses/>.
1616

1717
# Create mstore as subproject for testing
18-
mstore_dep = dependency(
18+
mstore_prj = subproject(
1919
'mstore',
20-
fallback: ['mstore', 'mstore_dep'],
20+
version: '>=0.1',
2121
required: not meson.is_subproject(),
22+
default_options: [
23+
'default_library=static',
24+
],
2225
)
2326
# If we do not find mstore and are a subproject, we just skip testing
24-
if not mstore_dep.found()
27+
if not mstore_prj.found()
2528
subdir_done()
2629
endif
30+
mstore_dep = mstore_prj.get_variable('mstore_dep')
2731

2832
tests = [
2933
'ncoord',

0 commit comments

Comments
 (0)