Skip to content

Commit ccfed5d

Browse files
committed
fix: add flags so that libraries get linked statically
1 parent 68e10f2 commit ccfed5d

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

meson.build

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
11
project(
22
'cpplox',
33
'cpp',
4-
version: '1.0.7',
4+
version: '1.0.8',
55
default_options: [
66
'warning_level=3',
77
'cpp_std=c++20',
88
],
99
)
1010

11+
# Make the executable static so that dll/so version mismatch can be avoided
12+
system = host_machine.system()
13+
if system == 'windows'
14+
add_project_arguments(['-static-libstdc++', '-static-libgcc'], language: 'cpp')
15+
elif system == 'linux'
16+
add_project_arguments(['-static-libstdc++', '-static-libgcc'], language: 'cpp')
17+
elif system == 'darwin'
18+
add_project_arguments(['-stdlib=libc++'], language: 'cpp')
19+
endif
20+
1121
include_dirs = include_directories(['include', 'thirdparty'])
1222
project_deps = [dependency('fmt', static: true)]
1323

src/bin/cpplox.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ int main(int argc, char *argv[])
7575

7676
if (result.count("version"))
7777
{
78-
fmt::println("v1.0.7");
78+
fmt::println("v1.0.8");
7979
exit(0);
8080
}
8181

0 commit comments

Comments
 (0)