-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathmeson.build
178 lines (163 loc) · 5.27 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
project('pfsshell', 'c', default_options: ['optimization=0', 'debug=true', 'warning_level=0'], version: 'v1.1.1')
add_global_arguments(['-Wno-unused-value', '-Wno-format', '-Wno-format-security', '-Wno-unused-function', '-Wno-unused-variable'], language : 'c')
cc = meson.get_compiler('c')
host_system = host_machine.system()
libfakeps2sdk_proj = subproject('fakeps2sdk')
libfakeps2sdk_noinclude_dep = libfakeps2sdk_proj.get_variable('libfakeps2sdk_noinclude_dep')
libapa_proj = subproject('apa')
libapa_dep = libapa_proj.get_variable('libapa_dep')
libpfs_proj = subproject('pfs')
libpfs_dep = libpfs_proj.get_variable('libpfs_dep')
libiomanX_proj = subproject('iomanX')
libiomanX_dep = libiomanX_proj.get_variable('libiomanX_dep')
libhdlfs_proj = subproject('hdlfs')
libhdlfs_dep = libhdlfs_proj.get_variable('libhdlfs_dep')
pfsshell_src = [
'src/startup.c',
'src/hl.c',
'src/host_adapter.c',
'src/util.c',
'src/shell.c',
]
pfsshell_cflags = []
if host_system == 'windows' and cc.get_id() != 'msvc' and cc.get_id() != 'clang-cl'
pfsshell_cflags += ['-DNEED_GETLINE']
endif
if host_system == 'linux'
pfsshell_cflags += ['-pthread']
endif
pfsshell_ldflags = []
if host_system == 'windows' and cc.get_id() != 'msvc' and cc.get_id() != 'clang-cl'
pfsshell_ldflags += ['-static']
endif
if host_system == 'linux'
pfsshell_ldflags += ['-lpthread']
endif
pfsshell_dependson = [
libfakeps2sdk_noinclude_dep,
libapa_dep,
libpfs_dep,
libiomanX_dep,
libhdlfs_dep,
]
pfsshell = executable('pfsshell', sources: pfsshell_src, c_args: pfsshell_cflags, link_args: pfsshell_ldflags, dependencies: pfsshell_dependson, install: true)
libps2hdd = shared_library('ps2hdd', sources: pfsshell_src, c_args: pfsshell_cflags, link_args: pfsshell_ldflags, dependencies: pfsshell_dependson, install: true)
if get_option('enable_pfsfuse') == true
if host_system == 'windows' and cc.get_id() != 'msvc' and cc.get_id() != 'clang-cl'
#Build libdokanfuse using CMake
run_command('./dokany.sh')
libfuse_include = include_directories(['external/dokany/dokan_fuse/include'])
libfuse_dep = cc.find_library('libdokanfuse2.dll',
dirs : [meson.current_source_dir() +'/external/dokany/dokan_fuse/build'])
else
libfuse_include = ['']
libfuse_dep = dependency('fuse')
endif
pfsfuse_src = [
'src/iomanx_adapter.c',
]
pfsfuse_cflags = []
if host_system == 'linux'
pfsfuse_cflags += ['-pthread']
endif
pfsfuse_cflags += ['-D_FILE_OFFSET_BITS=64']
pfsfuse_ldflags = []
if host_system == 'windows' and cc.get_id() != 'msvc' and cc.get_id() != 'clang-cl'
pfsfuse_ldflags += ['-static']
endif
if host_system == 'linux'
pfsfuse_ldflags += ['-lpthread']
endif
pfsfuse_dependson = [
libfakeps2sdk_noinclude_dep,
libapa_dep,
libpfs_dep,
libiomanX_dep,
libfuse_dep,
]
pfsfuse = executable('pfsfuse', sources: pfsfuse_src, include_directories : libfuse_include, c_args: pfsfuse_cflags, link_args: pfsfuse_ldflags, dependencies: pfsfuse_dependson, install: true)
endif
if get_option('enable_pfs2tar') == true
pfs2tar_src = [
'src/pfs2tar.c',
]
pfs2tar_cflags = []
if host_system == 'linux'
pfs2tar_cflags += ['-pthread']
endif
pfs2tar_cflags += ['-D_FILE_OFFSET_BITS=64']
pfs2tar_ldflags = []
if host_system == 'windows' and cc.get_id() != 'msvc' and cc.get_id() != 'clang-cl'
pfs2tar_ldflags += ['-static']
endif
if host_system == 'linux'
pfs2tar_ldflags += ['-lpthread']
endif
pfs2tar_dependson = [
libfakeps2sdk_noinclude_dep,
libapa_dep,
libpfs_dep,
libiomanX_dep,
]
pfs2tar = executable('pfs2tar', sources: pfs2tar_src, c_args: pfs2tar_cflags, link_args: pfs2tar_ldflags, dependencies: pfs2tar_dependson, install: true)
endif
if get_option('enable_pfsd') == true
pfsd_src = [
'src/pfsd.c',
'src/pfslib_compat.c',
]
pfsd_cflags = []
if host_system == 'linux'
pfsd_cflags += ['-pthread']
endif
pfsd_cflags += ['-D_FILE_OFFSET_BITS=64']
pfsd_ldflags = []
if host_system == 'windows' and cc.get_id() != 'msvc' and cc.get_id() != 'clang-cl'
pfsd_ldflags += ['-static']
endif
if host_system == 'linux'
pfsd_ldflags += ['-lpthread']
endif
pfsd_dependson = [
libfakeps2sdk_noinclude_dep,
libapa_dep,
libpfs_dep,
libiomanX_dep,
]
pfsd = executable('pfsd', sources: pfsd_src, c_args: pfsd_cflags, link_args: pfsd_ldflags, dependencies: pfsd_dependson, install: true)
endif
if get_option('enable_ps2kinst') == true
ps2kinst_src = [
'src/pfsd_client.c',
'src/pfslib_compat.c',
'src/ps2kinst.c',
]
ps2kinst_cflags = []
if host_system == 'linux'
ps2kinst_cflags += ['-pthread']
endif
ps2kinst_cflags += ['-D_FILE_OFFSET_BITS=64']
ps2kinst_ldflags = []
if host_system == 'windows' and cc.get_id() != 'msvc' and cc.get_id() != 'clang-cl'
ps2kinst_ldflags += ['-static']
endif
if host_system == 'linux'
ps2kinst_ldflags += ['-lpthread']
endif
ps2kinst_dependson = [
libfakeps2sdk_noinclude_dep,
libapa_dep,
libpfs_dep,
libiomanX_dep,
]
ps2kinst = executable('ps2kinst', sources: ps2kinst_src, c_args: ps2kinst_cflags, link_args: ps2kinst_ldflags, dependencies: ps2kinst_dependson, install: true)
endif
if host_system == 'windows' and cc.get_id() != 'msvc' and cc.get_id() != 'clang-cl'
archive = custom_target(
'archive',
output: meson.project_name() + '-' + meson.project_version() + '-win32.7z',
input: [pfsshell, libps2hdd, 'README.md', 'COPYING', 'COPYING.AFLv2'],
build_by_default: true,
command: [find_program('7z'), 'a', '@OUTPUT@', '@INPUT@']
)
endif