Building

From DuckStation Wiki
Revision as of 03:12, 1 January 2021 by Margen67 (talk | contribs) (Created page with "== Windows == '''Requirements:''' * Visual Studio 2019 1. Clone the repository with submodules: <code>git clone --recursive</code> or <code>git clone</code> and <code>git subm...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Windows

Requirements:

  • Visual Studio 2019

1. Clone the repository with submodules: git clone --recursive or git clone and git submodule update --init.

2. Open the Visual Studio solution duckstation.sln in the root, or "Open Folder" for CMake build.

3. Build solution.

4. Binaries are located in bin\x64.

5. Run duckstation-(sdl/qt)-x64-(config).exe.

macOS

NOTE: macOS is highly experimental and not tested by the developer. Use at your own risk, things may be horribly broken.

Requirements:

CMake (installed by default?) brew install cmake
SDL2 brew install sdl2
Qt 5 brew install qt5

1. Clone the repository. Submodules aren't necessary, there is only one and it is only used for Windows.

2. Clone the mac externals repository (for MoltenVK): git clone https://github.com/stenzek/duckstation-ext-mac.git dep/mac.

3. Create a build directory, either in-tree or elsewhere, e.g. mkdir build-release && cd build-release.

4. Run cmake to configure the build system: cmake -DCMAKE_BUILD_TYPE=Release -DQt5_DIR=/usr/local/opt/qt/lib/cmake/Qt5 ...

  • You may need to tweak Qt5_DIR depending on your system.

5. Compile the source code: make -j$(sysctl -n hw.activecpu)

  • -j$(sysctl -n hw.activecpu) uses the number of available CPU threads for a faster build.

6. Run the binary, located in the build directory under bin/duckstation-sdl, or bin/DuckStation.app for Qt.

Linux

Requirements (Debian/Ubuntu package names):

CMake cmake
SDL2 libsdl2-dev
GTK3 (for file selector) libgtk-3-dev
Qt 5 qtbase5-dev qtbase5-private-dev qtbase5-dev-tools qttools5-dev
Ninja ninja-build

1. Clone the repository. Submodules aren't necessary, there is only one and it is only used for Windows.

2. Create a build directory, either in-tree or elsewhere.

3. Run cmake to configure the build system. Assuming a build subdirectory of build-release: cd build-release && cmake -DCMAKE_BUILD_TYPE=Release -GNinja ...

4. Compile the source code. For the example above, run ninja.

5. Run the binary, located in the build directory under bin/duckstation-sdl, or bin/duckstation-qt.

Android

Requirements:

  • Android Studio with the NDK and CMake installed

1. Clone the repository. Submodules aren't necessary, there is only one and it is only used for Windows.

2. Open the project in the android directory.

3. Select Build -> Build Bundle(s) / APKs(s) -> Build APK(s).

4. Install APK on device, or use Run menu for attached device.