Skip to content

Commit

Permalink
Merge pull request #8 from soerengrunewald/feature/add-meson-build-su…
Browse files Browse the repository at this point in the history
…pport

meson: Add basic meson build support
  • Loading branch information
wghost authored Jun 11, 2020
2 parents 9fef93d + 9f47827 commit fa9b240
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 4 deletions.
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,23 @@ How to compile under Linux:

I did not have time to test the newest version of the tools under Linux. These instructions are for the older versions (v7.3 and below).

Install gcc-c++ (g++) compiler, cmake, git and any wxGTK-devel v.2.9+ package available for your distribution repository. There is one program which requires wxWidgets - DeserializeAll. Everything else should compile perfectly without wxGTK installed.
Install gcc-c++ (g++) compiler, meson, ninja, git and any wxGTK-devel v.2.9+ package available for your distribution repository.
There are some programs which requires wxWidgets:
- DecompressLZO
- DeserializeAll
- ExportTexturesToDDS
- ImportTexturesFromDDS

Everything else should compile perfectly without wxGTK installed.

Clone github repo and compile UPKUtils project:
```
git clone https://github.com/wghost/UPKUtils.git
cd UPKUtils/build
cmake .
make
meson build
cd build
ninja
```

To compile XComLZO packer/unpacker (deprecated):
```
cd UPKUtils/XComLZO/build
Expand Down
80 changes: 80 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
project('UPKUtils',
[ 'cpp', 'c' ],
default_options : [ 'cpp_std=c++14' ],
version : '1.6',
meson_version : '>=0.49')

common_src = [
'CustomTFC.cpp',
'LzoUtils.cpp',
'minilzo.c',
'UFlags.cpp',
'UObject.cpp',
'UObjectFactory.cpp',
'UPKInfo.cpp',
'UPKUtils.cpp',
'UToken.cpp',
'UTokenFactory.cpp',
]
libcommon = static_library('common', common_src)

# required by some of the binaries
wx_dep = dependency('wxwidgets',
version : '>=3.0.0',
required : true,
modules : ['std', 'stc'])

if wx_dep.found()
executable('DecompressLZO',
['DecompressLZO.cpp'],
link_with: libcommon,
dependencies : wx_dep)

executable('DeserializeAll',
['DeserializeAll.cpp'],
link_with: libcommon,
dependencies : wx_dep)

executable('ExportTexturesToDDS',
['ExportTexturesToDDS.cpp', 'dds.cpp'],
link_with: libcommon,
dependencies : wx_dep)

executable('ImportTexturesFromDDS',
['ImportTexturesFromDDS.cpp', 'dds.cpp'],
link_with: libcommon,
dependencies : wx_dep)
endif

executable('CompareUPK',
['CompareUPK.cpp', 'UPKInfo.cpp', 'UFlags.cpp'])

executable('ExtractNameLists',
['ExtractNameLists.cpp'],
link_with: libcommon)

executable('FindObjectByOffset',
['FindObjectByOffset.cpp'],
link_with: libcommon)

executable('FindObjectEntry',
['FindObjectEntry.cpp'],
link_with: libcommon)

executable('HexToPseudoCode',
['HexToPseudoCode.cpp'],
link_with: libcommon)

executable('MoveExpandFunction',
['MoveExpandFunction.cpp'],
link_with: libcommon)

executable('ParseTfc',
['ParseTfc.cpp', 'dds.cpp'],
link_with: libcommon)

executable('PatchUPK',
['PatchUPK.cpp', 'ModParser.cpp', 'ModScript.cpp'],
link_with: libcommon)

executable('UENativeTablesReader', ['UENativeTablesReader.cpp'])

0 comments on commit fa9b240

Please sign in to comment.