Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit 8615bb1

Browse files
authored
Merge pull request #241 from cortex-command-community/linux-build-fixes
Linux build fixes
2 parents 3316949 + 76ff27e commit 8615bb1

File tree

3 files changed

+24
-16
lines changed

3 files changed

+24
-16
lines changed

README.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ The Linux build uses the meson build system, and builds against system libraries
3939

4040
Dependencies:
4141

42-
* `g++>=8.1` (needs to support c++17)
42+
* `g++>=8.1` (needs to support c++17 filesystem)
4343
* `allegro4`
4444
* `loadpng`
4545
* `flac`
@@ -48,41 +48,44 @@ Dependencies:
4848
* `lz4`
4949
* `libpng`
5050
* `libX11`
51-
* `meson>=0.49`
51+
* `meson>=0.43`
5252
* `boost>=1.55`
5353
* `xorg-misc-fonts`
5454

5555
Building:
5656

5757
1. Install Dependencies (see below for some distro-specific instructions)
5858

59-
2. Clone this Source Repository and the [Data Respository](https://github.com/cortex-command-community/Cortex-Command-Community-Project-Data), folder structure doesn't really matter here
59+
2. Clone this Source Repository and the [Data Respository](https://github.com/cortex-command-community/Cortex-Command-Community-Project-Data)
6060

6161
3. open a terminal in the Source Repository
6262

6363
4. `meson builddir`
6464

6565
5. `cd builddir`
6666

67-
6. `meson compile` or `meson [-j<num of threads>] compile CCCP` if you want a release build
68-
If the build fails because of memory shortage you may need to reduce the number of build threads (meson will use all available threads by default) using the `-j<number of threads>` option
67+
For `meson` versions `>=0.54` (check `meson --version`):
68+
69+
6. `meson compile` for debug build, or `meson compile CCCP` for a release build. If the build fails because of memory shortage you may need to reduce the number of build threads (meson will use all available threads by default) using the `-j<number of threads>` option, if this doesn't help increase your swap size to at least 6Gb
70+
71+
For `meson` versions `<0.54`
72+
73+
6. `ninja` for debug builds, or `ninja CCCP.x86_64` for release builds. Using the `-j<number of threads>` option will also work here.
6974

7075

7176
Running:
7277

73-
1. Copy (or link, preferable for quick debug builds) `builddir/CCCP_debug.x86_64` or `builddir/CCCP.x86_64` (depending on if you made a release build) into the **Data Repository**
78+
1. Copy (or link, might be preferable for testing builds) `builddir/CCCP_debug.x86_64` or `builddir/CCCP.x86_64` (depending on if you made a release build) into the **Data Repository**
7479

7580
2. Copy `Scenes.rte` and `Metagames.rte` from your purchased copy of Cortex Command into **Data Repository**
7681

77-
3. Copy (or link) `libfmod.so.11` from `<Source Repository Root>/external/lib/linux/x86_64` into the **Data Repository**
78-
79-
4. Run `env LD_LIBRARY_PATH=. ./CCCP.x86_64` or `./CCCP_debug.x86_64` in the **Data Repository**
82+
3. Run `./CCCP.x86_64` or `./CCCP_debug.x86_64` in the **Data Repository**
8083

8184
### Arch Linux ###
8285
`# pacman -S allegro4 flac luajit minizip lz4 libpng libx11 meson xorg-fonts-misc`
8386

8487
### Ubuntu ###
85-
`# apt-get install liballegro4.4 libloadpng4-dev libflac++-dev luajit-5.1-dev libminizip-dev liblz4-dev libpng++-dev libx11-dev meson`
88+
`# apt-get install liballegro4-dev libloadpng4-dev libflac++-dev luajit-5.1-dev libminizip-dev liblz4-dev libpng++-dev libx11-dev meson`
8689

8790
### Troubleshooting ###
8891
Until borderless windows are implemented, you might seem get stuck in fullscreen mode. Try Alt-Return, or if that doesn't work kill CC with ctrl-alt-end.

external/lib/linux/x86_64/libfmod.so

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
libfmod.so.11

meson.build

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
project('CCOSS-community', ['cpp','c'], default_options:['cpp_std=c++17'])
1+
project('CCOSS-community', ['cpp','c'], default_options:['cpp_std=c++17'], version:'0.1.0-Pre-3')
22

33
source_inc_dirs = include_directories('Activities',
44
'Entities',
@@ -21,13 +21,17 @@ deps = [
2121
]
2222

2323
compiler = meson.get_compiler('cpp')
24-
24+
link_args=[]
25+
extra_args=[]
2526

2627
if meson.get_compiler('cpp').get_id() == 'gcc'
27-
extra_args = ['-pedantic','-fpermissive', '-Wno-write-strings', '-Wno-unknown-pragmas']
28+
extra_args = ['-fpermissive', '-Wno-write-strings', '-Wno-unknown-pragmas']
29+
release_args = ['-w']
2830
suffix = 'x86_64'
31+
if compiler.version().version_compare('<9')
32+
link_args += ['-lstdc++fs']
33+
endif
2934
elif meson.get_compiler('cpp').get_id() == 'msvc'
30-
extra_args = []
3135
endif
3236

3337
pch = 'System/StandardIncludes.h'
@@ -43,11 +47,11 @@ subdir('external')
4347

4448
debug = executable('CCCP_debug', 'Main.cpp',sources, link_with: [luabind_debug, raknet_debug, fmod],
4549
dependencies: [deps], include_directories:[source_inc_dirs, external_inc_dirs],
46-
cpp_args:extra_args, cpp_pch:pch, name_suffix:suffix, override_options:['buildtype=debugoptimized', 'optimization=g'])
50+
cpp_args:extra_args, link_args:link_args, cpp_pch:pch, name_suffix:suffix, override_options:['buildtype=debugoptimized', 'optimization=g'])
4751

4852
release = executable('CCCP', 'Main.cpp', sources, link_with: [luabind, raknet, fmod],
4953
dependencies: [deps], include_directories:[source_inc_dirs, external_inc_dirs],
50-
cpp_args:extra_args, cpp_pch:pch, name_suffix:suffix, build_by_default:false, override_options:['buildtype=release', 'optimization=3', 'debug=false'])
54+
cpp_args:extra_args, link_args:link_args+release_args, cpp_pch:pch, name_suffix:suffix, build_by_default:false, override_options:['buildtype=release', 'optimization=3', 'debug=false'])
5155

5256
#AppImage Targeting
5357
wget = find_program('wget')

0 commit comments

Comments
 (0)