From 44f2eee29e2ee989efc0fcda27d5e36cff11f7b8 Mon Sep 17 00:00:00 2001 From: Logan McNaughton <848146+loganmc10@users.noreply.github.com> Date: Wed, 5 Oct 2022 13:40:38 -0600 Subject: [PATCH] use cmake (#321) --- .github/workflows/build.yml | 2 +- build.sh | 47 +++++++++++++++---------------------- clean.sh | 6 ++--- 3 files changed, 22 insertions(+), 33 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fe97697..0aeda14 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,7 +13,7 @@ jobs: - name: Update and install packages run: | dnf -y update - dnf -y install pkgconf-pkg-config which cmake make nasm qt6-qtwebsockets-devel hidapi-devel zlib-devel libpng-devel SDL2_net-devel wget zip git ShellCheck + dnf -y install pkgconf-pkg-config which cmake ninja-build make nasm qt6-qtwebsockets-devel hidapi-devel zlib-devel libpng-devel SDL2_net-devel wget zip git ShellCheck - uses: actions/checkout@v3 - name: Check shell scripts run: | diff --git a/build.sh b/build.sh index 6bb0e16..30d9047 100755 --- a/build.sh +++ b/build.sh @@ -31,23 +31,23 @@ make NETPLAY=1 NO_ASM=1 OSD=0 V=1 -j4 all cp -P "${base_dir}/mupen64plus-core/projects/unix/"*"${suffix}"* "${install_dir}" cp "${base_dir}/mupen64plus-core/data/"* "${install_dir}" -cd "${base_dir}/simple64-input-raphnetraw/projects/unix" -make V=1 -j4 all -cp "${base_dir}/simple64-input-raphnetraw/projects/unix/"*"${suffix}" "${install_dir}" +mkdir -p "${base_dir}/simple64-input-raphnetraw/build" +cd "${base_dir}/simple64-input-raphnetraw/build" +cmake -G Ninja -DCMAKE_BUILD_TYPE=Release .. +VERBOSE=1 cmake --build . +cp simple64-input-raphnetraw.* "${install_dir}" mkdir -p "${base_dir}/simple64-input-qt/build" cd "${base_dir}/simple64-input-qt/build" -qmake6 ../simple64-input-qt.pro -make -j4 -if [[ ${UNAME} == *"MINGW"* ]]; then - cp "${base_dir}/simple64-input-qt/build/release/simple64-input-qt.dll" "${install_dir}" -else - cp "${base_dir}/simple64-input-qt/build/libsimple64-input-qt${suffix}" "${install_dir}/simple64-input-qt${suffix}" -fi +cmake -G Ninja -DCMAKE_BUILD_TYPE=Release .. +VERBOSE=1 cmake --build . +cp simple64-input-qt.* "${install_dir}" -cd "${base_dir}/simple64-audio-sdl2/projects/unix" -make V=1 -j4 all -cp "${base_dir}/simple64-audio-sdl2/projects/unix/"*"${suffix}" "${install_dir}" +mkdir -p "${base_dir}/simple64-audio-sdl2/build" +cd "${base_dir}/simple64-audio-sdl2/build" +cmake -G Ninja -DCMAKE_BUILD_TYPE=Release .. +VERBOSE=1 cmake --build . +cp simple64-audio-sdl2.* "${install_dir}" cd "${base_dir}" GUI_VERSION_FILE=${base_dir}/simple64-gui/version.h @@ -67,11 +67,10 @@ fi mkdir -p "${base_dir}/simple64-gui/build" cd "${base_dir}/simple64-gui/build" -qmake6 ../simple64-gui.pro -make -j4 -if [[ ${UNAME} == *"MINGW"* ]]; then - cp "${base_dir}/simple64-gui/build/release/simple64-gui.exe" "${install_dir}" -elif [[ ${UNAME} == *"Darwin"* ]]; then +cmake -G Ninja -DCMAKE_BUILD_TYPE=Release .. +VERBOSE=1 cmake --build . + +if [[ ${UNAME} == *"Darwin"* ]]; then "/usr/local/Cellar/qt/${qt_version}/bin/macdeployqt" "${base_dir}/simple64-gui/build/simple64-gui.app" cp -a "${base_dir}/simple64-gui/build/simple64-gui.app" "${install_dir}" else @@ -80,21 +79,13 @@ fi mkdir -p "${base_dir}/parallel-rsp/build" cd "${base_dir}/parallel-rsp/build" -if [[ ${UNAME} == *"MINGW"* ]]; then - cmake -G "MSYS Makefiles" -DCMAKE_BUILD_TYPE=Release .. -else - cmake -DCMAKE_BUILD_TYPE=Release .. -fi +cmake -G Ninja -DCMAKE_BUILD_TYPE=Release .. VERBOSE=1 cmake --build . cp simple64-rsp-parallel.* "${install_dir}" mkdir -p "${base_dir}/parallel-rdp-standalone/build" cd "${base_dir}/parallel-rdp-standalone/build" -if [[ ${UNAME} == *"MINGW"* ]]; then - cmake -G "MSYS Makefiles" -DCMAKE_BUILD_TYPE=Release .. -else - cmake -DCMAKE_BUILD_TYPE=Release .. -fi +cmake -G Ninja -DCMAKE_BUILD_TYPE=Release .. VERBOSE=1 cmake --build . cp simple64-video-parallel.* "${install_dir}" diff --git a/clean.sh b/clean.sh index e9d721f..c26aba1 100755 --- a/clean.sh +++ b/clean.sh @@ -3,13 +3,11 @@ set -e rm -rf simple64 -rm -rf simple64-audio-sdl2/projects/unix/_obj -rm -rf simple64-audio-sdl2/projects/unix/simple64-audio-sdl2.dylib +rm -rf simple64-audio-sdl2/build rm -rf mupen64plus-core/projects/unix/_obj rm -rf mupen64plus-core/projects/unix/libmupen64plus.dylib rm -rf simple64-gui/build rm -rf simple64-input-qt/build -rm -rf simple64-input-raphnetraw/projects/unix/_obj -rm -rf simple64-input-raphnetraw/projects/unix/simple64-input-raphnetraw.dylib +rm -rf simple64-input-raphnetraw/build rm -rf parallel-rsp/build rm -rf parallel-rdp-standalone/build