mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-22 22:13:35 +02:00
improve layout of some dev docs
This commit is contained in:
parent
764fbebb35
commit
0db567da37
@ -10,17 +10,17 @@ The following instructions apply to **v1.2 and later**. For earlier versions the
|
||||
2. JDK 11, not necessarily from Oracle
|
||||
3. Android command line tools or Android Studio for your OS: https://developer.android.com/studio/
|
||||
4. Android NDK version **r25c (25.2.9519653)**, there're multiple ways to obtain it:
|
||||
- - install with Android Studio
|
||||
- - install with `sdkmanager` command line tool
|
||||
- - download from https://developer.android.com/ndk/downloads
|
||||
- - download with Conan, see [#NDK and Conan](#ndk-and-conan)
|
||||
- install with Android Studio
|
||||
- install with `sdkmanager` command line tool
|
||||
- download from https://developer.android.com/ndk/downloads
|
||||
- download with Conan, see [#NDK and Conan](#ndk-and-conan)
|
||||
5. (optional) Ninja: download from your package manager or from https://github.com/ninja-build/ninja/releases
|
||||
|
||||
## Obtaining source code
|
||||
|
||||
Clone https://github.com/vcmi/vcmi with submodules. Example for command line:
|
||||
|
||||
```sh
|
||||
```
|
||||
git clone --recurse-submodules https://github.com/vcmi/vcmi.git
|
||||
```
|
||||
|
||||
@ -39,7 +39,7 @@ Conan must be aware of the NDK location when you execute `conan install`. There'
|
||||
|
||||
- the easiest is to download NDK from Conan (option 1 in the docs), then all the magic happens automatically. You need to create your own Conan profile that imports our Android profile and adds 2 new lines (you can of course just copy everything from our profile into yours without including) and then pass this new profile to `conan install`:
|
||||
|
||||
```sh
|
||||
```
|
||||
include(/path/to/vcmi/CI/conan/android-64)
|
||||
[tool_requires]
|
||||
android-ndk/r25c
|
||||
@ -47,7 +47,7 @@ android-ndk/r25c
|
||||
|
||||
- to use an already installed NDK, you can simply pass it on the command line to `conan install`:
|
||||
|
||||
```sh
|
||||
```
|
||||
conan install -c tools.android:ndk_path=/path/to/ndk ...
|
||||
```
|
||||
|
||||
@ -59,7 +59,7 @@ Building for Android is a 2-step process. First, native C++ code is compiled to
|
||||
|
||||
This is a traditional CMake project, you can build it from command line or some IDE. You're not required to pass any custom options (except Conan toolchain file), defaults are already good. If you wish to use your own CMake presets, inherit them from our `build-with-conan` preset. Example:
|
||||
|
||||
```sh
|
||||
```
|
||||
cmake -S . -B ../build -G Ninja -D CMAKE_BUILD_TYPE=Debug --toolchain ...
|
||||
cmake --build ../build
|
||||
```
|
||||
|
@ -10,7 +10,9 @@
|
||||
|
||||
Clone <https://github.com/vcmi/vcmi> with submodules. Example for command line:
|
||||
|
||||
`git clone --recurse-submodules https://github.com/vcmi/vcmi.git`
|
||||
```
|
||||
git clone --recurse-submodules https://github.com/vcmi/vcmi.git
|
||||
```
|
||||
|
||||
## Obtaining dependencies
|
||||
|
||||
@ -32,8 +34,10 @@ There're a few [CMake presets](https://cmake.org/cmake/help/latest/manual/cmake-
|
||||
|
||||
Open terminal and `cd` to the directory with source code. Configuration example for device with Conan:
|
||||
|
||||
`cmake --preset ios-device-conan \`
|
||||
` -D BUNDLE_IDENTIFIER_PREFIX=com.MY-NAME`
|
||||
```
|
||||
cmake --preset ios-device-conan \
|
||||
-D BUNDLE_IDENTIFIER_PREFIX=com.MY-NAME
|
||||
```
|
||||
|
||||
By default build directory containing Xcode project will appear at `../build-ios-device-conan`, but you can change it with `-B` option.
|
||||
|
||||
@ -53,7 +57,9 @@ You must also install game files, see [Installation on iOS](../players/Installat
|
||||
|
||||
### From command line
|
||||
|
||||
`cmake --build `<path to build directory>` --target vcmiclient -- -quiet`
|
||||
```
|
||||
cmake --build <path to build directory> --target vcmiclient -- -quiet
|
||||
```
|
||||
|
||||
You can pass additional xcodebuild options after the `--`. Here `-quiet` is passed to reduce amount of output.
|
||||
|
||||
|
@ -13,7 +13,9 @@
|
||||
|
||||
Clone <https://github.com/vcmi/vcmi> with submodules. Example for command line:
|
||||
|
||||
`git clone --recurse-submodules https://github.com/vcmi/vcmi.git`
|
||||
```
|
||||
git clone --recurse-submodules https://github.com/vcmi/vcmi.git
|
||||
```
|
||||
|
||||
# Obtaining dependencies
|
||||
|
||||
@ -33,10 +35,8 @@ Note: if you wish to build 1.0 release in non-`Release` configuration, you shoul
|
||||
## Homebrew
|
||||
|
||||
1. [Install Homebrew](https://brew.sh/)
|
||||
2. Install dependencies:
|
||||
`brew install boost minizip sdl2 sdl2_image sdl2_mixer sdl2_ttf tbb`
|
||||
3. If you want to watch in-game videos, also install FFmpeg:
|
||||
`brew install ffmpeg@4`
|
||||
2. Install dependencies: `brew install boost minizip sdl2 sdl2_image sdl2_mixer sdl2_ttf tbb`
|
||||
3. If you want to watch in-game videos, also install FFmpeg: `brew install ffmpeg@4`
|
||||
4. Install Qt dependency in either of the ways (note that you can skip this if you're not going to build Launcher):
|
||||
- `brew install qt@5` for Qt 5 or `brew install qt` for Qt 6
|
||||
- using [Qt Online Installer](https://www.qt.io/download) - choose **Go open source**
|
||||
@ -46,8 +46,7 @@ Note: if you wish to build 1.0 release in non-`Release` configuration, you shoul
|
||||
This applies only to Xcode-based toolchain. If `xcrun -f clang` prints errors, then use either of the following ways:
|
||||
|
||||
- select an Xcode instance from Xcode application - Preferences - Locations - Command Line Tools
|
||||
- use `xcode-select` utility to set Xcode or Xcode Command Line Tools path: for example,
|
||||
`sudo xcode-select -s /Library/Developer/CommandLineTools`
|
||||
- use `xcode-select` utility to set Xcode or Xcode Command Line Tools path: for example, `sudo xcode-select -s /Library/Developer/CommandLineTools`
|
||||
- set `DEVELOPER_DIR` environment variable pointing to Xcode or Xcode Command Line Tools path: for example, `export DEVELOPER_DIR=/Applications/Xcode.app`
|
||||
|
||||
# Configuring project for building
|
||||
@ -82,10 +81,10 @@ Open `VCMI.xcodeproj` from the build directory, select `vcmiclient` scheme and h
|
||||
|
||||
## From command line
|
||||
|
||||
`cmake --build `<path to build directory>
|
||||
`cmake --build <path to build directory>`
|
||||
|
||||
- If using Makefiles generator, you'd want to utilize all your CPU cores by appending `-- -j$(sysctl -n hw.ncpu)` to the above
|
||||
- If using Xcode generator, you can also choose which configuration to build by appending `--config `<configuration name> to the above, for example: `--config Debug`
|
||||
- If using Xcode generator, you can also choose which configuration to build by appending `--config <configuration name>` to the above, for example: `--config Debug`
|
||||
|
||||
# Packaging project into DMG file
|
||||
|
||||
@ -97,27 +96,23 @@ If you use Conan, it's expected that you use **conan-generated** directory at st
|
||||
|
||||
You can run VCMI from DMG, but it's will also work from your IDE be it Xcode or Qt Creator.
|
||||
|
||||
Alternatively you can run binaries directly from "bin" directory:
|
||||
Alternatively you can run binaries directly from the **bin** directory:
|
||||
|
||||
BUILD_DIR/bin/vcmilauncher
|
||||
BUILD_DIR/bin/vcmiclient
|
||||
BUILD_DIR/bin/vcmiserver
|
||||
- BUILD_DIR/bin/vcmilauncher
|
||||
- BUILD_DIR/bin/vcmiclient
|
||||
- BUILD_DIR/bin/vcmiserver
|
||||
|
||||
CMake include commands to copy all needed assets from source directory into "bin" on each build. They'll work when you build from Xcode too.
|
||||
CMake include commands to copy all needed assets from source directory into the **bin** directory on each build. They'll work when you build from Xcode too.
|
||||
|
||||
# Some useful debugging tips
|
||||
|
||||
Anyone who might want to debug builds, but new to macOS could find following commands useful:
|
||||
|
||||
- To attach DMG file from command line use
|
||||
`hdiutil attach vcmi-1.0.dmg`
|
||||
- Detach volume:
|
||||
`hdiutil detach /Volumes/vcmi-1.0`
|
||||
- To view dependency paths
|
||||
`otool -L /Volumes/vcmi-1.0/VCMI.app/Contents/MacOS/vcmiclient`
|
||||
- To display load commands such as LC_RPATH
|
||||
`otool -l /Volumes/vcmi-1.0/VCMI.app/Contents/MacOS/vcmiclient`
|
||||
- To attach DMG file from command line use `hdiutil attach vcmi-1.0.dmg`
|
||||
- Detach volume: `hdiutil detach /Volumes/vcmi-1.0`
|
||||
- To view dependency paths: `otool -L /Volumes/vcmi-1.0/VCMI.app/Contents/MacOS/vcmiclient`
|
||||
- To display load commands such as `LC_RPATH`: `otool -l /Volumes/vcmi-1.0/VCMI.app/Contents/MacOS/vcmiclient`
|
||||
|
||||
# Troubleshooting
|
||||
|
||||
In case of troubles you can always consult our CI build scripts or contact the dev team via slack
|
||||
In case of troubles you can always consult our CI build scripts or contact the dev team via slack.
|
||||
|
Loading…
Reference in New Issue
Block a user