|
7 | 7 | branches: [ "main" ] |
8 | 8 |
|
9 | 9 | jobs: |
10 | | - ubuntu: |
11 | | - runs-on: ubuntu-latest |
| 10 | + windows: |
| 11 | + runs-on: windows-latest |
12 | 12 |
|
13 | 13 | steps: |
14 | 14 | - name: Checkout Repository |
15 | 15 | uses: actions/checkout@v4 |
16 | 16 |
|
17 | | - - name: Install Dependencies |
18 | | - run: sudo apt-get update && sudo apt-get install -y g++ libx11-dev libxrandr-dev libgl1-mesa-dev libfreetype6-dev libjpeg-dev libopenal-dev libxcursor-dev libxi-dev libudev-dev libogg-dev libvorbis-dev libflac-dev libsndfile-dev libpthread-stubs0-dev libsfml-dev |
19 | | - |
20 | | - - name: Clone SFML 3.0 |
21 | | - run: git clone --branch 3.0.0 https://github.com/SFML/SFML.git |
22 | | - |
23 | | - - name: Build SFML 3.0 Manually |
| 17 | + - name: Install vcpkg |
24 | 18 | run: | |
25 | | - cd SFML/src |
26 | | - g++ -std=c++17 -c SFML/Window/*.cpp SFML/Graphics/*.cpp SFML/System/*.cpp |
27 | | - ar rcs libsfml.a *.o |
28 | | - sudo cp libsfml.a /usr/local/lib/ |
29 | | - sudo cp -r SFML /usr/local/include/ |
| 19 | + git clone https://github.com/microsoft/vcpkg |
| 20 | + cd vcpkg |
| 21 | + bootstrap-vcpkg.bat |
30 | 22 |
|
31 | | - - name: Compile C++ Project with SFML |
32 | | - run: g++ -std=c++17 main.cpp -o main -I/usr/local/include -L/usr/local/lib -lsfml-graphics -lsfml-window -lsfml-system |
| 23 | + - name: Install SFML and Dependencies via vcpkg |
| 24 | + run: | |
| 25 | + vcpkg install sfml:x64-windows |
| 26 | + vcpkg install openal-soft:x64-windows vorbis:x64-windows flac:x64-windows |
33 | 27 |
|
34 | | - - name: Verify SFML Version |
35 | | - run: sfml-config --version |
| 28 | + - name: Setup MSVC Compiler |
| 29 | + uses: ilammy/msvc-dev-cmd@v1.4.1 |
36 | 30 |
|
| 31 | + - name: Compile C++ Project with MSVC and SFML |
| 32 | + run: cl /EHsc /std:c++17 /I "C:\vcpkg\installed\x64-windows\include" main.cpp /link "/LIBPATH:C:\vcpkg\installed\x64-windows\lib" sfml-graphics.lib sfml-window.lib sfml-system.lib sfml-audio.lib sfml-network.lib |
37 | 33 |
|
38 | | - # Windows test doesn't work due to missing dependencies error |
39 | | -# windows: |
40 | | -# runs-on: windows-latest |
41 | | -# |
42 | | -# steps: |
43 | | -# - name: Checkout Repository |
44 | | -# uses: actions/checkout@v4 |
45 | | -# |
46 | | -# - name: Install vcpkg |
47 | | -# run: | |
48 | | -# if (!(Test-Path "C:\vcpkg")) { |
49 | | -# git clone https://github.com/microsoft/vcpkg C:\vcpkg |
50 | | -# cd C:\vcpkg |
51 | | -# bootstrap-vcpkg.bat |
52 | | -# } |
53 | | -# |
54 | | -# - name: Cache vcpkg |
55 | | -# uses: actions/cache@v3 |
56 | | -# with: |
57 | | -# path: C:\vcpkg |
58 | | -# key: vcpkg-${{ runner.os }} |
59 | | -# restore-keys: vcpkg- |
60 | | -# |
61 | | -# - name: Install SFML via vcpkg |
62 | | -# run: | |
63 | | -# vcpkg install sfml:x64-windows |
64 | | -# |
65 | | -# - name: Setup MSVC Compiler |
66 | | -# uses: ilammy/msvc-dev-cmd@v1.4.1 |
67 | | -# |
68 | | -# - name: Compile C++ Code with SFML |
69 | | -# run: | |
70 | | -# cl /EHsc /std:c++17 /I "C:\vcpkg\installed\x64-windows\include" main.cpp /link "/LIBPATH:C:\vcpkg\installed\x64-windows\lib" sfml-graphics.lib sfml-window.lib sfml-system.lib sfml-audio.lib sfml-network.lib |
71 | | -# |
72 | | -# - name: Run Executable |
73 | | -# run: main.exe |
74 | | -# shell: cmd |
| 34 | + - name: Verify SFML Installation |
| 35 | + run: dir C:\vcpkg\installed\x64-windows\lib | findstr sfml |
0 commit comments