Skip to content

Commit a4585f9

Browse files
committed
Add libslipr dependency to CMakeLists and pipelines
1 parent d9e1bf7 commit a4585f9

File tree

3 files changed

+62
-90
lines changed

3 files changed

+62
-90
lines changed

.github/workflows/build-ubuntu.yml

+5-13
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
name: CMake Build (Ubuntu x86-64)
22

33
on:
4-
push:
5-
branches:
6-
- master
7-
pull_request:
8-
branches:
9-
- master
4+
[push, pull_request]
105

116
env:
127
BUILD_TYPE: Release
@@ -15,25 +10,22 @@ env:
1510
jobs:
1611
build:
1712

18-
runs-on: ubuntu-latest
13+
runs-on: ubuntu-20.04
1914

2015
steps:
2116
- uses: actions/checkout@v1
2217
- name: Install dependencies
2318
shell: bash
2419
working-directory: ${{runner.workspace}}
2520
run: | # Fetch a new version of CMake, because the default is too old.
26-
wget -nv https://github.com/Kitware/CMake/releases/download/v$CMAKE_VERSION/cmake-$CMAKE_VERSION-Linux-x86_64.tar.gz \
27-
&& tar -zxf cmake-$CMAKE_VERSION-Linux-x86_64.tar.gz \
28-
&& sudo rm -f /etc/apt/sources.list.d/dotnetdev.list /etc/apt/sources.list.d/microsoft-prod.list \
29-
&& sudo apt-get update \
30-
&& sudo apt-get install gtk+-3.0 libcurl4-gnutls-dev libpcap0.8-dev libsdl2-dev qt5-default
21+
sudo apt-get update \
22+
&& sudo apt-get install cmake libcurl4-gnutls-dev libpcap0.8-dev libsdl2-dev qt5-default libslirp-dev libc6-dev
3123
- name: Create build environment
3224
run: mkdir ${{runner.workspace}}/build
3325
- name: Configure
3426
shell: bash
3527
working-directory: ${{runner.workspace}}/build
36-
run: ${{runner.workspace}}/cmake-$CMAKE_VERSION-Linux-x86_64/bin/cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE
28+
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE
3729
- name: Make
3830
shell: bash
3931
working-directory: ${{runner.workspace}}/build

.github/workflows/build-windows.yml

+3-9
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
name: CMake Build (Windows x86-64)
22

33
on:
4-
push:
5-
branches:
6-
- master
7-
pull_request:
8-
branches:
9-
- master
4+
[push, pull_request]
105

116
env:
127
BUILD_TYPE: Release
@@ -21,11 +16,10 @@ jobs:
2116
- name: Install MSYS2
2217
working-directory: ${{runner.workspace}}
2318
run: | # Fetch MSYS2 build from XQEmu. Official distribution causes a CI failure due to permission errors.
24-
Invoke-WebRequest -Uri "https://github.com/xqemu/ci-environment-msys2/releases/latest/download/msys64.7z" -OutFile "msys64.7z"
25-
7z x -y msys64.7z "-oC:\tools\"
19+
choco install msys2
2620
C:\tools\msys64\usr\bin\bash.exe -lc "pacman -Syuq --noconfirm"
2721
- name: Install dependencies
28-
run: C:\tools\msys64\usr\bin\bash.exe -lc "pacman -Sq --noconfirm git make mingw-w64-x86_64-{cmake,mesa,SDL2,qt5-static,toolchain}"
22+
run: C:\tools\msys64\usr\bin\bash.exe -lc "pacman -Sq --noconfirm git make mingw-w64-x86_64-{cmake,SDL2,qt5-static,toolchain,libslirp}"
2923
- name: Create build environment
3024
run: |
3125
New-Item -ItemType directory -Path ${{runner.workspace}}\melonDS\build

src/frontend/qt_sdl/CMakeLists.txt

+54-68
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
11
project(qt_sdl)
22

33
SET(SOURCES_QT_SDL
4-
main.cpp
5-
main_shaders.h
6-
EmuSettingsDialog.cpp
7-
InputConfigDialog.cpp
8-
VideoSettingsDialog.cpp
9-
AudioSettingsDialog.cpp
10-
WifiSettingsDialog.cpp
11-
Input.cpp
12-
LAN_PCap.cpp
13-
LAN_Socket.cpp
14-
OSD.cpp
15-
OSD_shaders.h
16-
font.h
17-
Platform.cpp
18-
PlatformConfig.cpp
19-
20-
../Util_ROM.cpp
21-
../Util_Video.cpp
22-
../Util_Audio.cpp
23-
../FrontendUtil.h
24-
../mic_blow.h
25-
26-
../../../melon.qrc
4+
main.cpp
5+
main_shaders.h
6+
EmuSettingsDialog.cpp
7+
InputConfigDialog.cpp
8+
VideoSettingsDialog.cpp
9+
AudioSettingsDialog.cpp
10+
WifiSettingsDialog.cpp
11+
Input.cpp
12+
LAN_PCap.cpp
13+
LAN_Socket.cpp
14+
OSD.cpp
15+
OSD_shaders.h
16+
font.h
17+
Platform.cpp
18+
PlatformConfig.cpp
19+
20+
../Util_ROM.cpp
21+
../Util_Video.cpp
22+
../Util_Audio.cpp
23+
../FrontendUtil.h
24+
../mic_blow.h
25+
26+
../../../melon.qrc
2727
)
2828

2929
if (WIN32)
30-
set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -i <SOURCE> -o <OBJECT>")
30+
set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -i <SOURCE> -o <OBJECT>")
3131
endif()
3232

3333
if (BUILD_STATIC AND QT5_STATIC_DIR)
34-
set(QT5_STATIC_BASE ${QT5_STATIC_DIR}/lib/cmake/Qt5)
35-
set(Qt5_DIR ${QT5_STATIC_BASE})
36-
set(Qt5Core_DIR ${QT5_STATIC_BASE}Core)
37-
set(Qt5Gui_DIR ${QT5_STATIC_BASE}Gui)
38-
set(Qt5Widgets_DIR ${QT5_STATIC_BASE}Widgets)
34+
set(QT5_STATIC_BASE ${QT5_STATIC_DIR}/lib/cmake/Qt5)
35+
set(Qt5_DIR ${QT5_STATIC_BASE})
36+
set(Qt5Core_DIR ${QT5_STATIC_BASE}Core)
37+
set(Qt5Gui_DIR ${QT5_STATIC_BASE}Gui)
38+
set(Qt5Widgets_DIR ${QT5_STATIC_BASE}Widgets)
3939
endif()
4040

4141
find_package(Qt5 COMPONENTS Core Gui Widgets REQUIRED)
@@ -44,64 +44,50 @@ set(CMAKE_AUTOMOC ON)
4444
set(CMAKE_AUTOUIC ON)
4545
set(CMAKE_AUTORCC ON)
4646

47+
find_package(Threads REQUIRED)
48+
find_package(Iconv REQUIRED)
4749
find_package(PkgConfig REQUIRED)
4850
pkg_check_modules(SDL2 REQUIRED sdl2)
51+
pkg_check_modules(SLIRP REQUIRED slirp)
4952

5053
if (WIN32 AND (CMAKE_BUILD_TYPE STREQUAL Release))
51-
add_executable(melonDS WIN32 ${SOURCES_QT_SDL})
54+
add_executable(melonDS WIN32 ${SOURCES_QT_SDL})
5255
else()
53-
add_executable(melonDS ${SOURCES_QT_SDL})
56+
add_executable(melonDS ${SOURCES_QT_SDL})
5457
endif()
5558

59+
target_link_libraries(melonDS ${CMAKE_THREAD_LIBS_INIT})
60+
5661
target_include_directories(melonDS PRIVATE ${SDL2_INCLUDE_DIRS})
5762
target_include_directories(melonDS PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
5863
target_include_directories(melonDS PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/..")
5964
target_include_directories(melonDS PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/../..")
6065
target_link_libraries(melonDS core)
6166

6267
if (BUILD_STATIC)
63-
target_link_libraries(melonDS -static ${SDL2_LIBRARIES})
68+
target_link_libraries(melonDS -static ${SDL2_LIBRARIES} ${SLIRP_LIBRARIES})
6469
else()
65-
target_link_libraries(melonDS ${SDL2_LIBRARIES})
70+
target_link_libraries(melonDS ${SDL2_LIBRARIES} ${SLIRP_LIBRARIES})
6671
endif()
6772

6873
if (UNIX)
69-
option(UNIX_PORTABLE "Make a portable build that looks for its configuration in the current directory" OFF)
70-
if (UNIX_PORTABLE)
71-
add_definitions(-DUNIX_PORTABLE)
72-
endif()
73-
74-
find_package(PkgConfig REQUIRED)
75-
pkg_check_modules(GTK3 REQUIRED gtk+-3.0)
76-
77-
target_include_directories(melonDS PRIVATE ${GTK3_INCLUDE_DIRS})
78-
target_link_libraries(melonDS ${GTK3_LIBRARIES})
79-
80-
ADD_DEFINITIONS(${GTK3_CFLAGS_OTHER})
81-
82-
add_custom_command(OUTPUT melon_grc.c
83-
COMMAND glib-compile-resources --sourcedir=${CMAKE_SOURCE_DIR}
84-
--target=${CMAKE_CURRENT_BINARY_DIR}/melon_grc.c
85-
--generate-source "${CMAKE_SOURCE_DIR}/melon_grc.xml"
86-
COMMAND glib-compile-resources --sourcedir=${CMAKE_SOURCE_DIR}
87-
--target=${CMAKE_CURRENT_BINARY_DIR}/melon_grc.h
88-
--generate-header "${CMAKE_SOURCE_DIR}/melon_grc.xml")
89-
90-
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
91-
target_link_libraries(melonDS dl slirp Qt5::Core Qt5::Gui Qt5::Widgets)
92-
endif ()
93-
94-
target_sources(melonDS PUBLIC melon_grc.c)
74+
option(PORTABLE "Make a portable build that looks for its configuration in the current directory" OFF)
75+
target_link_libraries(melonDS dl Qt5::Core Qt5::Gui Qt5::Widgets)
9576
elseif (WIN32)
96-
target_sources(melonDS PUBLIC "${CMAKE_SOURCE_DIR}/melon.rc")
97-
98-
target_link_libraries(melonDS slirp comctl32 d2d1 dwrite uxtheme ws2_32 iphlpapi gdi32)
99-
if (BUILD_STATIC)
100-
target_link_libraries(melonDS imm32 winmm version setupapi -static Qt5::Core Qt5::Gui Qt5::Widgets z zstd glib-2.0 intl iconv)
101-
else()
102-
target_link_libraries(melonDS Qt5::Core Qt5::Gui Qt5::Widgets)
103-
endif()
104-
endif ()
77+
option(PORTABLE "Make a portable build that looks for its configuration in the current directory" ON)
78+
target_sources(melonDS PUBLIC "${CMAKE_SOURCE_DIR}/melon.rc")
79+
80+
target_link_libraries(melonDS comctl32 d2d1 dwrite uxtheme ws2_32 iphlpapi gdi32)
81+
if (BUILD_STATIC)
82+
target_link_libraries(melonDS imm32 winmm version setupapi -static Qt5::Core Qt5::Gui Qt5::Widgets z zstd glib-2.0 intl iconv)
83+
else()
84+
target_link_libraries(melonDS Qt5::Core Qt5::Gui Qt5::Widgets)
85+
endif()
86+
endif()
87+
88+
if (PORTABLE)
89+
add_definitions(-DPORTABLE)
90+
endif()
10591

10692
install(FILES ../../../net.kuribo64.melonDS.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications)
10793
install(FILES ../../../icon/melon_16x16.png DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/16x16/apps RENAME net.kuribo64.melonDS.png)

0 commit comments

Comments
 (0)