This repository has been archived by the owner on Mar 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
meson.build
86 lines (70 loc) · 2.66 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
project('PCSX2-MultiConfigTool',
'cpp', 'c',
meson_version : '>=0.52.0')
#Setup local variables
OF_ExeName = 'pcsx2-multiconfigtool'
IF_Lic = './' + 'LICENSE'
OF_Lic = meson.current_build_dir() + '/license.h' #The builddir doesn't need including via 'include_directories', so the file is found by the compiler
src_tool = ['./src/appconfig.c',
'./src/inifile.c',
'./src/pcsx2_multiconfigtool.cpp']
src_gui = ['./src/UI_wx/wxwin_functions.cpp',
'./src/UI_wx/wxwin_main.cpp',
'./src/UI_wx/wxwin_selectpaths.cpp']
#Include directories
inc_tool = include_directories('./src')
inc_gui = include_directories('./src/UI_wx')
inc_res = include_directories('./resources')
cmdparam_xxd = ['-i',
'-u',
IF_Lic,
OF_Lic]
cmdparam_sed = ['-i',
'-e',
'1i /**\\n * This File is autogenerated by the buildsystem\\n * DO NOT EDIT!\\n */',
'-e',
'/char/ c static const unsigned char ucaLicense_m[] ={',
'-e',
's/};/ ,0x00};/',
'-e',
'$d',
OF_Lic]
if build_machine.system() == 'windows'
#compile static wxWidgets on windows
add_project_link_arguments('--static',
language : ['cpp']) #This is needed to also link other libraries static
wxDep = dependency('wxwidgets',
version : '>=3.0.0',
method : 'config-tool',
static : true,
required : true,
modules : ['std', 'stc'])
wxResCmpArgs = []
foreach str : wxDep.get_configtool_variable('rescomp').strip().split()
if str.to_lower() == 'windres'
continue #skip windres executable name
endif
wxResCmpArgs += str
endforeach
mod_rescomp = import('windows')
src_gui += mod_rescomp.compile_resources('./resources/pcsx2tool_theme_win32.rc',
args : [wxResCmpArgs])
else
wxDep = dependency('wxwidgets',
version : '>=3.0.0',
required : true,
modules : ['std', 'stc'])
endif
#generate license file for including
run_command('xxd',
cmdparam_xxd,
check : true)
#modify generated licensefile (make it a valid .c-file)
run_command('sed',
cmdparam_sed,
check : true)
executable(OF_ExeName,
sources : [src_gui, src_tool],
include_directories : [inc_gui, inc_tool, inc_res],
dependencies : wxDep,
gui_app : true)