-
Notifications
You must be signed in to change notification settings - Fork 9
/
meson.build
112 lines (96 loc) · 2.98 KB
/
meson.build
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
################################################################################
##
## This file is part of the Hades GBA Emulator, and is made available under
## the terms of the GNU General Public License version 2.
##
## Copyright (C) 2021-2024 - The Hades Authors
##
################################################################################
project(
'Hades',
'c',
'cpp',
version: '1.0.0',
license: 'GPL-2.0-only',
default_options: ['c_std=gnu17', 'cpp_std=c++11', 'buildtype=release'],
)
incdir = include_directories('include', 'source')
cflags = [
'-fms-extensions',
'-Wno-microsoft-anon-tag',
'-DHADES_VERSION="@0@"'.format(meson.project_version()),
# '-fsanitize=undefined',
]
ldflags = [
# '-fsanitize=undefined',
]
static_dependencies = get_option('static_executable') or get_option('static_dependencies')
if get_option('static_executable')
cflags += ['-static']
ldflags += ['-static']
endif
if get_option('with_debugger')
cflags += ['-DWITH_DEBUGGER']
ldflags += ['-DWITH_DEBUGGER']
endif
cc = meson.get_compiler('c')
###############################
## External Dependencies ##
###############################
subdir('external')
###############################
## GBA Emulator Core Library ##
###############################
subdir('source/gba')
###############################
## Application ##
###############################
subdir('source/app')
if host_machine.system() == 'windows'
winrc = import('windows').compile_resources('./resource/windows/hades.rc')
hades = executable(
'Hades',
'source/log.c',
winrc,
win_subsystem: 'windows',
link_with: [libapp],
include_directories: [incdir, imgui_inc],
c_args: cflags,
link_args: ldflags,
install: true,
)
elif host_machine.system() == 'darwin'
hades = executable(
'hades',
'source/log.c',
link_with: [libapp],
include_directories: [incdir, imgui_inc],
c_args: cflags,
link_args: ldflags,
install: true,
)
install_data('./resource/macos/Info.plist', install_dir: 'Contents')
install_data('./resource/macos/hades.icns', install_dir: 'Contents/Resources')
elif host_machine.system() == 'linux' # Linux
hades = executable(
'hades',
'source/log.c',
link_with: [libapp],
include_directories: [incdir, imgui_inc],
c_args: cflags,
link_args: ldflags,
install: true,
)
install_data('./resource/linux/hades.desktop', install_dir: 'share/applications')
install_data('./resource/linux/hades.png', install_dir: 'share/icons/hicolor/256x256/apps')
else # Not supported officially, but there's no reason not to try and build them anyway
hades = executable(
'hades',
'source/log.c',
link_with: [libapp],
include_directories: [incdir, imgui_inc],
c_args: cflags,
link_args: ldflags,
install: true,
)
endif