@@ -5,41 +5,80 @@ Building:
55
66You need:
77* C++17 compiler.
8- * cmake >= 3.1
9- * libsndfiles
8+ * CMake >= 3.1.
9+ * PCM input/output backend:
10+ * ` libsndfile ` on Linux and MSYS2.
11+ * Media Foundation on Windows with MSVC.
12+ * Python 3 (optional, only required to run the integration tests).
1013
11- In case of git clone command GHA submodule should be fetched :
14+ If the source was cloned with git, fetch submodules first :
1215
1316```
1417git submodule update --init --recursive
1518```
1619
17- binary:
20+ The PCM backend can be selected with ` ATRACDENC_PCM_IO_BACKEND ` .
21+ Supported values are ` auto ` , ` mediafoundation ` , and ` libsndfile ` .
22+ The default is ` mediafoundation ` for MSVC Windows builds and ` libsndfile `
23+ everywhere else.
24+
25+ Linux, Debian/Ubuntu based:
1826
1927```
20- cd src
21- mkdir build
22- cd build
23- cmake ../
24- make
28+ sudo apt update
29+ sudo apt install -y build-essential cmake libsndfile1-dev python3 googletest libgtest-dev
30+
31+ cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DATRACDENC_PCM_IO_BACKEND=libsndfile
32+ cmake --build build -j"$(nproc)"
33+ ctest --test-dir build --output-on-failure
2534```
2635
27- Binary and tests (for development):
36+ The binary is created at ` build/src/atracdenc ` .
37+
38+ Windows, MSYS2 MinGW64:
2839
29- Make sure google test library is installed
40+ Run the commands from the ` MSYS2 MinGW x64 ` shell.
3041
31- debian:
3242```
33- apt-get install libgtest-dev cmake-extras
43+ pacman -S --needed \
44+ git \
45+ mingw-w64-x86_64-cmake \
46+ mingw-w64-x86_64-gcc \
47+ mingw-w64-x86_64-gtest \
48+ mingw-w64-x86_64-libsndfile \
49+ mingw-w64-x86_64-ninja \
50+ mingw-w64-x86_64-python
51+
52+ cmake -S . -B build-msys2 -G Ninja \
53+ -DCMAKE_BUILD_TYPE=Release \
54+ -DATRACDENC_PCM_IO_BACKEND=libsndfile
55+ cmake --build build-msys2
56+ ctest --test-dir build-msys2 --output-on-failure
3457```
3558
36- Now we can build
59+ The binary is created at ` build-msys2/src/atracdenc.exe ` .
60+
61+ To create a redistributable directory with required MSYS2 runtime DLLs and
62+ license files:
63+
3764```
38- cd test
39- cmake ../
40- make
65+ bash tools/package-msys2-runtime.sh build-msys2/src/atracdenc.exe dist-msys2
4166```
4267
68+ Windows, MSVC:
69+
70+ Install Visual Studio or Visual Studio Build Tools with the C++ desktop
71+ workload. Run the commands from an ` x64 Native Tools Command Prompt for VS ` .
72+
73+ ```
74+ cmake -S . -B build-msvc -G "Visual Studio 17 2022" -A x64 ^
75+ -DATRACDENC_PCM_IO_BACKEND=mediafoundation
76+ cmake --build build-msvc --config Release
77+ ctest --test-dir build-msvc -C Release --output-on-failure
78+ ```
79+
80+ The binary is created at ` build-msvc/src/Release/atracdenc.exe ` .
81+
4382Usage:
4483
4584ATRAC1:
0 commit comments