Merge branch 'meson-vs2019' of github.com:TypesettingTools/Aegisub into meson-vs2019

This commit is contained in:
odrling 2020-06-13 12:50:14 +02:00
commit f00e5e3ebc
6 changed files with 82 additions and 107 deletions

View File

@ -1,9 +1,11 @@
project('Aegisub', ['c', 'cpp'],
license: 'BSD-3-Clause',
meson_version: '>=0.49.0',
meson_version: '>=0.51.0',
default_options: ['c_std=c11', 'cpp_std=c++11', 'b_lto=true'],
version: '3.2.2')
cmake = import('cmake')
if host_machine.system() == 'windows'
version_sh = find_program('tools/version.ps1')
else
@ -11,7 +13,7 @@ else
endif
version_inc = include_directories('.')
version_h = custom_target('git_version.h',
command: [version_sh, meson.source_root()],
command: [version_sh, meson.current_build_dir()],
build_by_default: true,
build_always_stale: true, # has internal check whether target file will be refreshed
output: ['git_version.h', 'git_version.xml'])
@ -61,7 +63,8 @@ deps += dependency('libass', version: '>=0.9.7',
deps += dependency('boost', version: '>=1.50.0',
modules: ['chrono', 'filesystem', 'locale', 'regex',
'system', 'thread'])
'system', 'thread'],
static: get_option('default_library') == 'static')
if host_machine.system() == 'windows'
conf.set('BOOST_USE_WINDOWS_H', '1')
endif
@ -71,16 +74,46 @@ deps += dependency('zlib', fallback: ['zlib', 'zlib_dep'])
wx_dep = dependency('wxWidgets', version: '>=3.0.0',
required: cxx.get_id() != 'msvc',
modules: ['std', 'stc', 'gl'])
if not wx_dep.found() # this will only be hit with msvc
if wx_dep.found()
deps += wx_dep
else # this will only be hit with msvc
if get_option('wx_path') != ''
deps_inc += include_directories(get_option('wx_path') / 'include' / 'msvc', get_option('wx_path') / 'include')
add_project_arguments('-DUNICODE', '-D_UNICODE', language: 'cpp')
add_project_arguments('-DwxMSVC_VERSION_AUTO', '-DWXUSINGDLL', language: 'cpp')
else
error('wxWidgets not found and no wx_path defined.')
buildShared = 'ON'
if get_option('default_library') == 'static'
buildShared = 'OFF'
endif
wx = cmake.subproject('wxWidgets', cmake_options: ['-DwxBUILD_INSTALL=OFF',
'-DwxBUILD_PRECOMP=OFF', # otherwise breaks project generation w/ meson
'-DwxBUILD_SHARED=@0@'.format(buildShared),
'-DwxBUILD_MONOLITHIC=ON']) # otherwise breaks project generation w/ meson
deps += [
wx.dependency('mono'),
wx.dependency('wxzlib'),
wx.dependency('wxpng'),
wx.dependency('wxexpat'),
wx.dependency('wxscintilla')
]
if host_machine.system() == 'windows'
if cc.has_header('rpc.h')
deps += cc.find_library('rpcrt4', required: true)
else
error('Missing Windows SDK RPC Library (rpc.h / rpcrt4.lib)')
endif
if cc.has_header('commctrl.h')
deps += cc.find_library('comctl32', required: true)
else
error('Missing Windows SDK Common Controls Library (commctrl.h / comctl32.lib)')
endif
endif
endif
endif
deps += wx_dep
icu_uc_dep = dependency('icu-uc', version: '>=4.8.1.1', required: cxx.get_id() != 'msvc')
icu_i18n_dep = dependency('icu-i18n', version: '>=4.8.1.1', required: cxx.get_id() != 'msvc')
@ -135,8 +168,10 @@ if host_machine.system() == 'windows' and not get_option('directsound').disabled
if not have_dsound_h and get_option('directsound').enabled()
error('DirectSound enabled but dsound.h not found')
endif
if dsound_dep.found() and winmm_dep.found() and ole32_dep.found() and have_dsound_h
deps += [dsound_dep, winmm_dep, ole32_dep]
dxguid_dep = cc.find_library('dxguid', required: true)
if dsound_dep.found() and winmm_dep.found() and ole32_dep.found() and dxguid_dep.found() and have_dsound_h
deps += [dsound_dep, winmm_dep, ole32_dep, dxguid_dep]
conf.set('WITH_DIRECTSOUND', '1')
dep_avail += 'DirectSound'
endif

View File

@ -38,98 +38,6 @@
#include <sys/param.h>
#endif
// wxWidgets headers
#include <wx/defs.h> // Leave this first.
#include <wx/accel.h>
#include <wx/app.h>
#include <wx/arrstr.h>
#include <wx/bitmap.h>
#include <wx/bmpbuttn.h>
#include <wx/brush.h>
#include <wx/button.h>
#include <wx/checkbox.h>
#include <wx/checklst.h>
#include <wx/choicdlg.h>
#include <wx/choice.h>
#include <wx/clipbrd.h>
#include <wx/colour.h>
#include <wx/combobox.h>
#include <wx/containr.h>
#include <wx/control.h>
#include <wx/ctrlsub.h>
#include <wx/cursor.h>
#include <wx/dataobj.h>
#include <wx/dc.h>
#include <wx/dcbuffer.h>
#include <wx/dcclient.h>
#include <wx/dcmemory.h>
#include <wx/dcprint.h>
#include <wx/dialog.h>
#include <wx/dirdlg.h>
#include <wx/dnd.h>
#include <wx/dynarray.h>
#include <wx/event.h>
#include <wx/file.h>
#include <wx/filedlg.h>
#include <wx/filefn.h>
#include <wx/filename.h>
#include <wx/font.h>
#include <wx/frame.h>
#include <wx/gdicmn.h>
#include <wx/gdiobj.h>
#include <wx/glcanvas.h>
#include <wx/hash.h>
#include <wx/hashmap.h>
#include <wx/icon.h>
#include <wx/image.h>
#include <wx/intl.h>
#include <wx/layout.h>
#include <wx/list.h>
#include <wx/listbox.h>
#include <wx/listctrl.h>
#include <wx/log.h>
#include <wx/math.h>
#include <wx/memory.h>
#include <wx/menu.h>
#include <wx/menuitem.h>
#include <wx/module.h>
#include <wx/msgdlg.h>
#include <wx/object.h>
#include <wx/palette.h>
#include <wx/panel.h>
#include <wx/pen.h>
#include <wx/power.h>
#include <wx/radiobox.h>
#include <wx/radiobut.h>
#include <wx/region.h>
#include <wx/sashwin.h>
#include <wx/scrolwin.h>
#include <wx/settings.h>
#include <wx/sizer.h>
#include <wx/spinctrl.h>
#include <wx/statbox.h>
#include <wx/statline.h>
#include <wx/stattext.h>
#include <wx/statusbr.h>
#include <wx/stc/stc.h>
#include <wx/stopwatch.h>
#include <wx/strconv.h>
#include <wx/stream.h>
#include <wx/string.h>
#include <wx/textctrl.h>
#include <wx/thread.h>
#include <wx/timer.h>
#include <wx/toolbar.h>
#include <wx/toplevel.h>
#include <wx/utils.h>
#include <wx/valgen.h>
#include <wx/validate.h>
#include <wx/valtext.h>
#include <wx/window.h>
#include <wx/wxcrt.h>
#include <wx/wxcrtvararg.h>
#ifdef HAVE_OPENGL_GL_H
#include <OpenGL/gl.h>
#else

View File

@ -171,6 +171,20 @@ if host_machine.system() == 'darwin'
'osx/retina_helper.mm',
'osx/scintilla_ime.mm',
]
elif host_machine.system() == 'windows'
aegisub_src += [
'font_file_lister_gdi.cpp'
]
if cc.has_header('wingdi.h')
deps += cc.find_library('gdi32', required: true)
else
error('Missing Windows SDK GDI Library (wingdi.h / gdi32.lib)')
endif
if cc.has_header('usp10.h')
deps += cc.find_library('usp10', required: true)
else
error('Missing Windows SDK Uniscribe Library (usp10.h / usp10.lib)')
endif
elif conf.get('WITH_FONTCONFIG') == '1'
aegisub_src += 'font_file_lister_fontconfig.cpp'
endif
@ -206,4 +220,5 @@ aegisub = executable('aegisub', aegisub_src, version_h, acconf,
cpp_pch: aegisub_cpp_pch,
c_pch: aegisub_c_pch,
install: true,
dependencies: deps)
dependencies: deps,
gui_app: true)

View File

@ -275,7 +275,7 @@ wxString LocalizedLanguageName(wxString const& lang) {
icu::UnicodeString ustr;
iculoc.getDisplayName(iculoc, ustr);
#ifdef _MSC_VER
return wxString(ustr.getBuffer());
return wxString((const wchar_t*)ustr.getBuffer());
#else
std::string utf8;
ustr.toUTF8String(utf8);

View File

@ -0,0 +1,5 @@
[wrap-git]
directory = wxWidgets
url = https://github.com/wxWidgets/wxWidgets.git
revision = master
clone-recursive = true

View File

@ -1,20 +1,32 @@
#!/usr/bin/env powershell
param (
[Parameter(Position = 0, Mandatory = $false)]
[string]$BuildRoot = $null
)
$lastSvnRevision = 6962
$lastSvnHash = '16cd907fe7482cb54a7374cd28b8501f138116be'
$defineNumberMatch = [regex] '^#define\s+(\w+)\s+(\d+)$'
$defineStringMatch = [regex] "^#define\s+(\w+)\s+[`"']?(.+?)[`"']?$"
$semVerMatch = [regex] 'v?(\d+)\.(\d+).(\d+)(?:-(\w+))?'
$repositoryRootPath = Join-Path $PSScriptRoot .. | Resolve-Path
if (!(git -C $repositoryRootPath rev-parse --is-inside-work-tree 2>$null)) {
throw "$repositoryRootPath is not a git repository"
}
$gitVersionHeaderPath = Join-Path $repositoryRootPath 'src' | Join-Path -ChildPath 'include' | Join-Path -ChildPath 'aegisub' `
| Join-Path -ChildPath 'git_version.h'
$gitVersionXmlPath = Join-Path $repositoryRootPath 'packages' | Join-Path -ChildPath 'win_installer' `
| Join-Path -ChildPath 'git_version.xml'
if ($BuildRoot -eq $null -or $BuildRoot.Trim() -eq "") {
$BuildRoot = $repositoryRootPath
}
# support legacy in-tree builds
if ([System.IO.Path]::GetFullPath([System.IO.Path]::Combine((pwd).Path, $BuildRoot)) -eq
[System.IO.Path]::GetFullPath([System.IO.Path]::Combine((pwd).Path, $repositoryRootPath))) {
$BuildRoot = Join-Path $repositoryRootPath 'build'
}
$gitVersionHeaderPath = Join-Path $BuildRoot 'git_version.h'
$gitVersionXmlPath = Join-Path $repositoryRootPath 'build' | Join-Path -ChildPath 'git_version.xml'
$version = @{}
if (Test-Path $gitVersionHeaderPath) {