Skip to content

Commit 7f1b56f

Browse files
authored
Merge pull request #109 from StarbotArc/cmake-4-lujix
Linux build support.
2 parents 15ff1ef + 368bafe commit 7f1b56f

File tree

781 files changed

+658
-371304
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

781 files changed

+658
-371304
lines changed

.github/workflows/windows.yml

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
name: Windows Build
2-
31
on:
42
push:
5-
branches: ["main"]
3+
pull_request:
4+
branches:
5+
- beta
6+
paths-ignore:
7+
- '**.md'
8+
9+
name: Latest Beta
610

711
jobs:
812
windows:
@@ -13,7 +17,7 @@ jobs:
1317
working-directory: ${{github.workspace}}/main
1418
steps:
1519
- name: Get AV
16-
uses: actions/checkout@v3
20+
uses: actions/checkout@v4
1721
with:
1822
path: main
1923
- name: Get MSBuild
@@ -22,23 +26,18 @@ jobs:
2226
run: >
2327
curl https://www.rarewares.org/files/ogg/oggenc2.88-1.3.7-x64.zip --output oggenc.zip &&
2428
unzip oggenc.zip -d .
29+
- name: Configure CMake
30+
run: cmake -Bbuild -DCMAKE_BUILD_TYPE=Release
2531
- name: Build AV
26-
run: msbuild build\VisualStudio\ArrowVortex.vcxproj /p:Configuration=Release /p:Platform=x64
27-
- name: Collect into a zip
32+
run: cmake --build build --config Release
33+
- name: Collect into a directory
2834
run: |
2935
mkdir AV
30-
cd AV
31-
cp -r ../bin/assets .
32-
cp -r ../bin/noteskins .
33-
cp -r ../bin/settings .
34-
cp ../bin/ArrowVortex.exe .
35-
cp ../oggenc2.exe .
36-
cd ..
37-
7z.exe a -tzip av.zip AV
38-
- name: Upload to Delta VPS
39-
run: |
40-
mkdir -p ~/.ssh
41-
echo "${{ secrets.DROPLET_SSH }}" > ~/.ssh/arrow_vortex
42-
chmod 400 ~/.ssh/arrow_vortex
43-
echo "arrowvortex@167.71.33.176:~/av/ArrowVortex-$(date +'%Y-%m-%d %H-%M-%S').zip" > DROPLET_PATH
44-
scp -o StrictHostKeyChecking=no -o PasswordAuthentication=no -i ~/.ssh/arrow_vortex av.zip $(cat DROPLET_PATH)
36+
cmake --install build --config Release --prefix ./AV
37+
mv oggenc2.exe AV/bin
38+
- name: Upload artifact
39+
uses: actions/upload-artifact@v4
40+
with:
41+
name: AV
42+
path: main/AV/bin
43+
if-no-files-found: error

.gitignore

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -396,11 +396,12 @@ FodyWeavers.xsd
396396

397397
# JetBrains Rider
398398
*.sln.iml
399-
/bin/ArrowVortex_d.exe
400-
bin/settings/recent files.txt
401-
bin/settings/settings.txt
402-
bin/ArrowVortex.exe
403-
build/VisualStudio/ArrowVortex.vcxproj
404-
/bin/ArrowVortex.exe
405-
/bin/settings/recent files.txt
406-
/bin/settings/settings.txt
399+
400+
.envrc
401+
.direnv
402+
shell.nix
403+
404+
# vcpkg and building-related
405+
vcpkg_installed
406+
build
407+
out

CMakeLists.txt

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
cmake_minimum_required(VERSION 3.30)
2+
3+
if (LINUX)
4+
set(CMAKE_SYSTEM_NAME Windows)
5+
6+
set(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc)
7+
set(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++)
8+
9+
set(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32)
10+
11+
option(VCPKG "Use vcpkg for dependencies" ON)
12+
endif()
13+
14+
if(WIN32)
15+
option(VCPKG "Use vcpkg for dependencies" ON)
16+
else()
17+
option(VCPKG "Use vcpkg for dependencies" OFF)
18+
endif()
19+
20+
if(VCPKG)
21+
set(VCPKG_LIBRARY_LINKAGE "static")
22+
if(DEFINED ENV{VCPKG_INSTALLATION_ROOT})
23+
set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake" CACHE STRING "")
24+
elseif(DEFINED ENV{VCPKG_ROOT})
25+
set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" CACHE STRING "")
26+
endif()
27+
endif()
28+
29+
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
30+
31+
set(CMAKE_CXX_STANDARD 14)
32+
set(CMAKE_CXX_STANDARD_REQUIRED True)
33+
34+
project(ArrowVortex)
35+
36+
set(CMAKE_CONFIGURATION_TYPES Debug Release)
37+
38+
include_directories("${PROJECT_SOURCE_DIR}/src")
39+
40+
find_package(Freetype REQUIRED)
41+
find_package(MAD REQUIRED)
42+
find_package(Ogg CONFIG REQUIRED)
43+
find_package(Vorbis REQUIRED)
44+
find_package(OpenGL REQUIRED)
45+
46+
add_subdirectory(src/Core)
47+
add_subdirectory(src/Dialogs)
48+
add_subdirectory(src/Editor)
49+
add_subdirectory(src/Managers)
50+
add_subdirectory(src/Simfile)
51+
add_subdirectory(src/System)
52+
53+
install(TARGETS ArrowVortex RUNTIME)
54+
install(DIRECTORY bin/assets DESTINATION bin)
55+
install(DIRECTORY bin/noteskins DESTINATION bin)
56+
install(DIRECTORY bin/settings DESTINATION bin)

CMakeSettings.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"configurations": [
3+
{
4+
"name": "Debug",
5+
"generator": "Ninja",
6+
"configurationType": "Debug",
7+
"inheritEnvironments": [ "msvc_x64_x64" ],
8+
"buildRoot": "${projectDir}\\out\\build\\${name}",
9+
"installRoot": "${projectDir}\\out\\install\\${name}",
10+
"cmakeCommandArgs": "",
11+
"buildCommandArgs": "",
12+
"ctestCommandArgs": ""
13+
},
14+
{
15+
"name": "Release",
16+
"generator": "Ninja",
17+
"configurationType": "RelWithDebInfo",
18+
"buildRoot": "${projectDir}\\out\\build\\${name}",
19+
"installRoot": "${projectDir}\\out\\install\\${name}",
20+
"cmakeCommandArgs": "",
21+
"buildCommandArgs": "",
22+
"ctestCommandArgs": "",
23+
"inheritEnvironments": [ "msvc_x64_x64" ]
24+
}
25+
]
26+
}

CREDITS

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,24 +27,27 @@ status of the original code as provided to them.
2727

2828
Code from the following projects is included in this repository:
2929

30-
1. freetype, using the FreeType License, which is compatible with GPLv3
31-
See lib/freetype/ for more info.
30+
1. freetype , using the FreeType License, which is compatible with GPLv3
31+
See lib/freetype/ or https://freetype.org/license.html for more info.
3232

3333
2. libogg & libvorbis, using its BSD-style license, which is compatible with
34-
GPLv3. See lib/libvorbis/license for more info.
34+
GPLv3. See lib/libvorbis/license or https://gitlab.xiph.org/xiph for more info.
3535

3636
3. libmad, using the GPL license (libmad allows for GPLv2 or any later version)
37-
See lib/freetype/ for more info.
37+
See lib/freetype/ or https://www.underbit.com/products/mad/ for more info.
3838

3939
4. lua, using its GPLv3-compatible permissive license
40-
See lib/lua/ for more info.
40+
See lib/lua/ or https://www.lua.org/license.html for more info.
4141

4242
5. Code from liir.c by Exstrom Labratories, which is GPL, is present in
4343
src/Editor/Butterworth.cpp
44+
https://www.exstrom.com/journal/sigproc/dsigproc.html
4445

4546
6. Code from Takuya OOURA's General Purpose FFT Package, which is released
4647
freely, is present in src/Editor/FFT.cpp
48+
https://www.kurims.kyoto-u.ac.jp/~ooura/fft.html
4749

4850
7. Code from the aubio library, which is also GPLv3, is present in
4951
src/Editor/Aubio.h and src/Editor/FindOnsets.cpp
52+
https://github.com/aubio/aubio
5053

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,30 @@ Some new features were introduced as well when preparing this release, and some
6969

7070
## Building ArrowVortex
7171

72+
### Windows
73+
7274
In order to compile ArrowVortex on your own PC, Visual Studio is required. It is recommended to use Visual Studio 2022 with the "Desktop development for C++" components installed.
7375

7476
Simply open `build/VisualStudio/ArrowVortex.sln` in Visual Studio, and build the project.
7577

78+
### Linux
79+
80+
Compiling for Linux requires that you have `vcpkg`, `powershell`, and `cmake`.
81+
82+
Once you have those set up, run `export VCPKG_ROOT={where your vcpkg contents is}`.
83+
84+
This command is needed as to find and define vcpkg's root and use it when building with cmake.
85+
86+
Now you may run this: `cmake -B build -DVCPKG_TARGET_TRIPLET=x64-mingw-static -DCMAKE_TOOLCHAIN_FILE=${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake`
87+
88+
This command specifies that you are using a MinGW environment that is statically linked and targets 64-bit, and for cmake to account for vcpkg.
89+
90+
This command also requires powershell as it is used for vcpkg's copy tools, and will fail to compile if it isn't installed.
91+
92+
Now enter your build directory with `cd build`.
93+
94+
Finally, build ArrowVortex with `cmake --build .`.
95+
7696
## License
7797

7898
ArrowVortex is provided under the GPLv3 license, or at your option, any later version.

build/VisualStudio/ArrowVortex.rc

-3.2 KB
Binary file not shown.

build/VisualStudio/ArrowVortex.sln

Lines changed: 0 additions & 158 deletions
This file was deleted.

0 commit comments

Comments
 (0)