mirror of
https://github.com/isledecomp/isle-portable.git
synced 2026-02-03 12:31:15 +00:00
modified ajenbos original attempt to get libraries
This commit is contained in:
parent
c0655fbc6f
commit
1413356618
139
.github/workflows/ci.yml
vendored
139
.github/workflows/ci.yml
vendored
@ -25,7 +25,6 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
name: ${{ matrix.name }}
|
name: ${{ matrix.name }}
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
container: ${{ matrix.container || '' }}
|
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
shell: ${{ matrix.shell || 'sh' }}
|
shell: ${{ matrix.shell || 'sh' }}
|
||||||
@ -34,15 +33,14 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- { name: 'Linux', os: 'ubuntu-latest', dx5: false, config: true, linux: true, werror: true, clang-tidy: true }
|
- { name: 'Linux', os: 'ubuntu-latest', dx5: false, config: true, build-type: 'Debug', linux: true, werror: true, clang-tidy: true }
|
||||||
- { name: 'MSVC (x86)', os: 'windows-latest', dx5: true, config: true, msvc: true, werror: false, clang-tidy: false, vc-arch: 'amd64_x86' }
|
- { name: 'MSVC (x86)', os: 'windows-latest', dx5: true, config: false, build-type: 'Debug', msvc: true, werror: false, clang-tidy: false, vc-arch: 'amd64_x86' }
|
||||||
- { name: 'MSVC (x64)', os: 'windows-latest', dx5: false, config: true, msvc: true, werror: false, clang-tidy: false, vc-arch: 'amd64' }
|
- { name: 'MSVC (x64)', os: 'windows-latest', dx5: false, config: true, build-type: 'Debug', msvc: true, werror: false, clang-tidy: false, vc-arch: 'amd64' }
|
||||||
- { name: 'MSVC (arm64)', os: 'windows-latest', dx5: false, config: true, msvc: true, werror: false, clang-tidy: false, vc-arch: 'amd64_arm64' }
|
- { name: 'MSVC (arm64)', os: 'windows-latest', dx5: false, config: false, build-type: 'Debug', msvc: true, werror: false, clang-tidy: false, vc-arch: 'amd64_arm64' }
|
||||||
- { name: 'msys2 mingw32', os: 'windows-latest', dx5: false, config: true, mingw: true, werror: true, clang-tidy: true, msystem: 'mingw32', msys-env: 'mingw-w64-i686', shell: 'msys2 {0}' }
|
- { name: 'msys2 mingw32', os: 'windows-latest', dx5: false, config: false, build-type: 'Debug', mingw: true, werror: true, clang-tidy: true, msystem: 'mingw32', msys-env: 'mingw-w64-i686', shell: 'msys2 {0}' }
|
||||||
- { name: 'msys2 mingw64', os: 'windows-latest', dx5: false, config: true, mingw: true, werror: true, clang-tidy: true, msystem: 'mingw64', msys-env: 'mingw-w64-x86_64', shell: 'msys2 {0}' }
|
- { name: 'msys2 mingw64', os: 'windows-latest', dx5: false, config: true, build-type: 'Debug', mingw: true, werror: true, clang-tidy: true, msystem: 'mingw64', msys-env: 'mingw-w64-x86_64', shell: 'msys2 {0}' }
|
||||||
- { name: 'macOS', os: 'macos-latest', dx5: false, config: true, brew: true, werror: true, clang-tidy: false }
|
- { name: 'macOS', os: 'macos-latest', dx5: false, config: true, build-type: 'Debug', brew: true, werror: true, clang-tidy: false }
|
||||||
- { name: 'Emscripten', os: 'ubuntu-latest', dx5: false, config: false, emsdk: true, werror: true, clang-tidy: false, cmake-wrapper: 'emcmake' }
|
- { name: 'Emscripten', os: 'ubuntu-latest', dx5: false, config: false, build-type: 'Debug', emsdk: true, werror: true, clang-tidy: false, cmake-wrapper: 'emcmake' }
|
||||||
- { name: 'Nintendo 3DS', os: 'ubuntu-latest', dx5: false, config: false, n3ds: true, werror: true, clang-tidy: false, container: 'devkitpro/devkitarm:latest', cmake-args: '-DCMAKE_TOOLCHAIN_FILE=/opt/devkitpro/cmake/3DS.cmake' }
|
|
||||||
steps:
|
steps:
|
||||||
- name: Setup vcvars
|
- name: Setup vcvars
|
||||||
if: ${{ !!matrix.msvc }}
|
if: ${{ !!matrix.msvc }}
|
||||||
@ -62,14 +60,19 @@ jobs:
|
|||||||
${{ matrix.msys-env }}-clang-tools-extra
|
${{ matrix.msys-env }}-clang-tools-extra
|
||||||
${{ (matrix.config && format('{0}-qt6-base', matrix.msys-env)) || '' }}
|
${{ (matrix.config && format('{0}-qt6-base', matrix.msys-env)) || '' }}
|
||||||
|
|
||||||
|
- name: Install Qt
|
||||||
|
if: ${{ !!matrix.msvc && matrix.config }}
|
||||||
|
uses: jurplel/install-qt-action@v4
|
||||||
|
with:
|
||||||
|
cache: 'true'
|
||||||
|
|
||||||
- name: Install Linux dependencies (apt-get)
|
- name: Install Linux dependencies (apt-get)
|
||||||
if: ${{ matrix.linux }}
|
if: ${{ matrix.linux }}
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y \
|
sudo apt-get install -y \
|
||||||
libx11-dev libxext-dev libxrandr-dev libxrender-dev libxfixes-dev libxi-dev libxinerama-dev \
|
libx11-dev libxext-dev libxrandr-dev libxrender-dev libxfixes-dev libxi-dev libxinerama-dev \
|
||||||
libxcursor-dev libwayland-dev libxkbcommon-dev wayland-protocols libgl1-mesa-dev qt6-base-dev \
|
libxcursor-dev libwayland-dev libxkbcommon-dev wayland-protocols libgl1-mesa-dev libglew-dev qt6-base-dev
|
||||||
libasound2-dev qt6-xdgdesktopportal-platformtheme
|
|
||||||
|
|
||||||
- name: Install macOS dependencies (brew)
|
- name: Install macOS dependencies (brew)
|
||||||
if: ${{ matrix.brew }}
|
if: ${{ matrix.brew }}
|
||||||
@ -77,10 +80,6 @@ jobs:
|
|||||||
brew update
|
brew update
|
||||||
brew install cmake ninja llvm qt6
|
brew install cmake ninja llvm qt6
|
||||||
echo "LLVM_ROOT=$(brew --prefix llvm)/bin" >> $GITHUB_ENV
|
echo "LLVM_ROOT=$(brew --prefix llvm)/bin" >> $GITHUB_ENV
|
||||||
- name: Install Qt
|
|
||||||
if: ${{ !matrix.n3ds }}
|
|
||||||
uses: jurplel/install-qt-action@v4
|
|
||||||
|
|
||||||
|
|
||||||
- name: Setup Emscripten
|
- name: Setup Emscripten
|
||||||
uses: mymindstorm/setup-emsdk@master
|
uses: mymindstorm/setup-emsdk@master
|
||||||
@ -95,97 +94,26 @@ jobs:
|
|||||||
- name: Configure (CMake)
|
- name: Configure (CMake)
|
||||||
run: |
|
run: |
|
||||||
${{ matrix.cmake-wrapper || '' }} cmake -S . -B build -GNinja \
|
${{ matrix.cmake-wrapper || '' }} cmake -S . -B build -GNinja \
|
||||||
${{ matrix.cmake-args || '' }} \
|
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
|
||||||
-DISLE_USE_DX5=${{ !!matrix.dx5 }} \
|
-DISLE_USE_DX5=${{ !!matrix.dx5 }} \
|
||||||
-DISLE_BUILD_CONFIG=${{ !!matrix.config }} \
|
-DISLE_BUILD_CONFIG=${{ matrix.config }} \
|
||||||
-DENABLE_CLANG_TIDY=${{ !!matrix.clang-tidy }} \
|
-DENABLE_CLANG_TIDY=${{ !!matrix.clang-tidy }} \
|
||||||
-DISLE_WERROR=${{ !!matrix.werror }} \
|
-DISLE_WERROR=${{ !!matrix.werror }} \
|
||||||
-DISLE_DEBUG=OFF \
|
|
||||||
-Werror=dev
|
-Werror=dev
|
||||||
|
|
||||||
- name: Build (CMake)
|
- name: Build (CMake)
|
||||||
run: cmake --build build --verbose
|
run: cmake --build build --verbose
|
||||||
|
|
||||||
- name: Pack QT Libs(windows)
|
|
||||||
if: ${{ matrix.os == 'windows-latest' }}
|
|
||||||
run: |
|
|
||||||
cd build
|
|
||||||
mkdir QTLibs
|
|
||||||
windeployqt isle-config.exe --dir QTLibs
|
|
||||||
|
|
||||||
- name: Package (CPack)
|
- name: Package (CPack)
|
||||||
if: ${{ !matrix.n3ds }}
|
|
||||||
run: |
|
run: |
|
||||||
cd build
|
cd build
|
||||||
cpack .
|
cpack .
|
||||||
|
|
||||||
- name: Install linuxdeploy
|
|
||||||
if: ${{ matrix.linux }}
|
|
||||||
id: install-linuxdeploy
|
|
||||||
uses: miurahr/install-linuxdeploy-action@v1.8.0
|
|
||||||
with:
|
|
||||||
plugins: qt appimage
|
|
||||||
|
|
||||||
- name: Package (AppImage)
|
|
||||||
if: ${{ matrix.linux }}
|
|
||||||
run: |
|
|
||||||
cd build && \
|
|
||||||
export LD_LIBRARY_PATH=".:$LD_LIBRARY_PATH" && \
|
|
||||||
NO_STRIP=1 ${{ steps.install-linuxdeploy.outputs.linuxdeploy }} \
|
|
||||||
-p qt \
|
|
||||||
-e isle \
|
|
||||||
-e isle-config \
|
|
||||||
-d packaging/linux/org.legoisland.Isle.desktop \
|
|
||||||
-i icons/org.legoisland.Isle.svg \
|
|
||||||
--custom-apprun=../packaging/linux/appimage/AppRun \
|
|
||||||
--appdir packaging/linux/appimage/AppDir \
|
|
||||||
--output appimage && \
|
|
||||||
mv *.AppImage dist/
|
|
||||||
|
|
||||||
- name: Package (3DS)
|
|
||||||
if: ${{ matrix.n3ds }}
|
|
||||||
run: |
|
|
||||||
cd build
|
|
||||||
mkdir dist
|
|
||||||
mv *.3dsx dist/
|
|
||||||
|
|
||||||
- name: Upload Build Artifacts
|
- name: Upload Build Artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: '${{ matrix.name }}'
|
name: '${{ matrix.name }} ${{ matrix.build-type }}'
|
||||||
path: |
|
path: build/dist/isle-*
|
||||||
build/dist/isle-*
|
|
||||||
build/dist/*.AppImage
|
|
||||||
build/dist/*.3dsx
|
|
||||||
|
|
||||||
flatpak:
|
|
||||||
name: "Flatpak (${{ matrix.arch }})"
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- arch: x86_64
|
|
||||||
os: ubuntu-latest
|
|
||||||
|
|
||||||
- arch: aarch64
|
|
||||||
os: ubuntu-22.04-arm
|
|
||||||
|
|
||||||
container:
|
|
||||||
image: ghcr.io/flathub-infra/flatpak-github-actions:kde-6.8
|
|
||||||
options: --privileged
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Build Flatpak
|
|
||||||
uses: flatpak/flatpak-github-actions/flatpak-builder@v6
|
|
||||||
with:
|
|
||||||
bundle: org.legoisland.Isle.${{ matrix.arch }}.flatpak
|
|
||||||
manifest-path: packaging/linux/flatpak/org.legoisland.Isle.json
|
|
||||||
arch: ${{ matrix.arch }}
|
|
||||||
|
|
||||||
ncc:
|
ncc:
|
||||||
name: 'C++'
|
name: 'C++'
|
||||||
@ -224,31 +152,4 @@ jobs:
|
|||||||
LEGO1/omni/include/flic.h \
|
LEGO1/omni/include/flic.h \
|
||||||
LEGO1/omni/src/video/flic.cpp \
|
LEGO1/omni/src/video/flic.cpp \
|
||||||
$action_headers \
|
$action_headers \
|
||||||
--path LEGO1/omni LEGO1/lego/legoomni
|
--path LEGO1/omni LEGO1/lego/legoomni
|
||||||
|
|
||||||
release:
|
|
||||||
name: 'Release'
|
|
||||||
if: ${{ github.event_name == 'push' && github.ref_name == 'master' }}
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs:
|
|
||||||
- build
|
|
||||||
- flatpak
|
|
||||||
steps:
|
|
||||||
- name: Download All Artifacts
|
|
||||||
uses: actions/download-artifact@main
|
|
||||||
with:
|
|
||||||
pattern: "*"
|
|
||||||
path: Release
|
|
||||||
merge-multiple: true
|
|
||||||
|
|
||||||
- name: Checkout uploadtool
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
repository: 'probonopd/uploadtool'
|
|
||||||
path: 'uploadtool'
|
|
||||||
|
|
||||||
- name: Upload Continuous Release
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
run: |
|
|
||||||
./uploadtool/upload.sh Release/*
|
|
||||||
118
CMakeLists.txt
118
CMakeLists.txt
@ -4,7 +4,7 @@ project(isle LANGUAGES CXX C VERSION 0.1)
|
|||||||
|
|
||||||
if (EMSCRIPTEN)
|
if (EMSCRIPTEN)
|
||||||
add_compile_options(-pthread)
|
add_compile_options(-pthread)
|
||||||
add_link_options(-sALLOW_MEMORY_GROWTH=1 -sMAXIMUM_MEMORY=2gb -sUSE_PTHREADS=1 -sPROXY_TO_PTHREAD=1 -sOFFSCREENCANVAS_SUPPORT=1 -sPTHREAD_POOL_SIZE_STRICT=0 -sFORCE_FILESYSTEM=1 -sWASMFS=1 -sEXIT_RUNTIME=1)
|
add_link_options(-sALLOW_MEMORY_GROWTH=1 -sMAXIMUM_MEMORY=2gb -sUSE_PTHREADS=1 -sPROXY_TO_PTHREAD=1 -sPTHREAD_POOL_SIZE_STRICT=0 -sFORCE_FILESYSTEM=1 -sWASMFS=1 -sEXIT_RUNTIME=1)
|
||||||
set(SDL_PTHREADS ON CACHE BOOL "Enable SDL pthreads" FORCE)
|
set(SDL_PTHREADS ON CACHE BOOL "Enable SDL pthreads" FORCE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@ -13,9 +13,6 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
|
|||||||
include(CheckCXXSourceCompiles)
|
include(CheckCXXSourceCompiles)
|
||||||
include(CMakeDependentOption)
|
include(CMakeDependentOption)
|
||||||
include(CMakePushCheckState)
|
include(CMakePushCheckState)
|
||||||
include(CMake/detectcpu.cmake)
|
|
||||||
|
|
||||||
DetectTargetCPUArchitectures(ISLE_CPUS)
|
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 17)
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
@ -29,7 +26,7 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_program(SDL_SHADERCROSS_BIN NAMES "shadercross")
|
find_program(SDL_SHADERCROSS_BIN NAMES "shadercross")
|
||||||
find_package(Python3 3.11 COMPONENTS Interpreter)
|
find_package(Python3 COMPONENTS Interpreter)
|
||||||
|
|
||||||
option(ISLE_BUILD_APP "Build isle application" ON)
|
option(ISLE_BUILD_APP "Build isle application" ON)
|
||||||
option(ISLE_ASAN "Enable Address Sanitizer" OFF)
|
option(ISLE_ASAN "Enable Address Sanitizer" OFF)
|
||||||
@ -38,7 +35,7 @@ option(ISLE_WERROR "Treat warnings as errors" OFF)
|
|||||||
option(ISLE_DEBUG "Enable imgui debug" ON)
|
option(ISLE_DEBUG "Enable imgui debug" ON)
|
||||||
cmake_dependent_option(ISLE_USE_DX5 "Build with internal DirectX 5 SDK" "${NOT_MINGW}" "WIN32;CMAKE_SIZEOF_VOID_P EQUAL 4" OFF)
|
cmake_dependent_option(ISLE_USE_DX5 "Build with internal DirectX 5 SDK" "${NOT_MINGW}" "WIN32;CMAKE_SIZEOF_VOID_P EQUAL 4" OFF)
|
||||||
cmake_dependent_option(ISLE_MINIWIN "Use miniwin" ON "NOT ISLE_USE_DX5" OFF)
|
cmake_dependent_option(ISLE_MINIWIN "Use miniwin" ON "NOT ISLE_USE_DX5" OFF)
|
||||||
cmake_dependent_option(ISLE_BUILD_CONFIG "Build CONFIG.EXE application" ON "MSVC OR ISLE_MINIWIN;NOT NINTENDO_3DS" OFF)
|
cmake_dependent_option(ISLE_BUILD_CONFIG "Build CONFIG.EXE application" ON "MSVC OR ISLE_MINIWIN" OFF)
|
||||||
cmake_dependent_option(ISLE_COMPILE_SHADERS "Compile shaders" ON "SDL_SHADERCROSS_BIN;TARGET Python3::Interpreter" OFF)
|
cmake_dependent_option(ISLE_COMPILE_SHADERS "Compile shaders" ON "SDL_SHADERCROSS_BIN;TARGET Python3::Interpreter" OFF)
|
||||||
option(CMAKE_POSITION_INDEPENDENT_CODE "Build with -fPIC" ON)
|
option(CMAKE_POSITION_INDEPENDENT_CODE "Build with -fPIC" ON)
|
||||||
option(ENABLE_CLANG_TIDY "Enable clang-tidy")
|
option(ENABLE_CLANG_TIDY "Enable clang-tidy")
|
||||||
@ -54,8 +51,6 @@ message(STATUS "Internal miniwin: ${ISLE_MINIWIN}")
|
|||||||
message(STATUS "Isle debugging: ${ISLE_DEBUG}")
|
message(STATUS "Isle debugging: ${ISLE_DEBUG}")
|
||||||
message(STATUS "Compile shaders: ${ISLE_COMPILE_SHADERS}")
|
message(STATUS "Compile shaders: ${ISLE_COMPILE_SHADERS}")
|
||||||
|
|
||||||
add_library(Isle::iniparser INTERFACE IMPORTED)
|
|
||||||
|
|
||||||
if (DOWNLOAD_DEPENDENCIES)
|
if (DOWNLOAD_DEPENDENCIES)
|
||||||
# FetchContent downloads and configures dependencies
|
# FetchContent downloads and configures dependencies
|
||||||
message(STATUS "Fetching SDL3 and iniparser. This might take a while...")
|
message(STATUS "Fetching SDL3 and iniparser. This might take a while...")
|
||||||
@ -78,7 +73,6 @@ if (DOWNLOAD_DEPENDENCIES)
|
|||||||
set(BUILD_DOCS off)
|
set(BUILD_DOCS off)
|
||||||
set(BUILD_SHARED_LIBS off)
|
set(BUILD_SHARED_LIBS off)
|
||||||
FetchContent_MakeAvailable(iniparser)
|
FetchContent_MakeAvailable(iniparser)
|
||||||
target_link_libraries(Isle::iniparser INTERFACE iniparser-static)
|
|
||||||
endblock()
|
endblock()
|
||||||
else()
|
else()
|
||||||
# find_package looks for already-installed system packages.
|
# find_package looks for already-installed system packages.
|
||||||
@ -86,8 +80,10 @@ else()
|
|||||||
# to add search paths.
|
# to add search paths.
|
||||||
find_package(SDL3 CONFIG REQUIRED)
|
find_package(SDL3 CONFIG REQUIRED)
|
||||||
|
|
||||||
find_package(iniparser REQUIRED CONFIG COMPONENTS shared)
|
find_package(iniparser CONFIG COMPONENTS static)
|
||||||
target_link_libraries(Isle::iniparser INTERFACE iniparser-shared)
|
if (NOT TARGET iniparser-static)
|
||||||
|
find_package(iniparser REQUIRED MODULE COMPONENTS static)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||||
@ -472,7 +468,6 @@ if (ISLE_BUILD_APP)
|
|||||||
add_executable(isle WIN32
|
add_executable(isle WIN32
|
||||||
ISLE/res/isle.rc
|
ISLE/res/isle.rc
|
||||||
ISLE/isleapp.cpp
|
ISLE/isleapp.cpp
|
||||||
ISLE/islefiles.cpp
|
|
||||||
)
|
)
|
||||||
list(APPEND isle_targets isle)
|
list(APPEND isle_targets isle)
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
@ -488,7 +483,7 @@ if (ISLE_BUILD_APP)
|
|||||||
target_link_libraries(isle PRIVATE $<$<BOOL:${ISLE_USE_DX5}>:DirectX5::DirectX5>)
|
target_link_libraries(isle PRIVATE $<$<BOOL:${ISLE_USE_DX5}>:DirectX5::DirectX5>)
|
||||||
|
|
||||||
# Link SDL and iniparser
|
# Link SDL and iniparser
|
||||||
target_link_libraries(isle PRIVATE SDL3::SDL3 Isle::iniparser)
|
target_link_libraries(isle PRIVATE SDL3::SDL3 iniparser-static)
|
||||||
|
|
||||||
# Allow unconditional include of miniwin/miniwindevice.h
|
# Allow unconditional include of miniwin/miniwindevice.h
|
||||||
target_link_libraries(isle PRIVATE miniwin-headers)
|
target_link_libraries(isle PRIVATE miniwin-headers)
|
||||||
@ -523,18 +518,12 @@ if (ISLE_BUILD_APP)
|
|||||||
target_compile_definitions(isle PRIVATE "ISLE_EMSCRIPTEN_HOST=\"${ISLE_EMSCRIPTEN_HOST}\"")
|
target_compile_definitions(isle PRIVATE "ISLE_EMSCRIPTEN_HOST=\"${ISLE_EMSCRIPTEN_HOST}\"")
|
||||||
set_property(TARGET isle PROPERTY SUFFIX ".html")
|
set_property(TARGET isle PROPERTY SUFFIX ".html")
|
||||||
endif()
|
endif()
|
||||||
if(NINTENDO_3DS)
|
|
||||||
target_sources(isle PRIVATE
|
|
||||||
ISLE/3ds/apthooks.cpp
|
|
||||||
ISLE/3ds/config.cpp
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (ISLE_BUILD_CONFIG)
|
if (ISLE_BUILD_CONFIG)
|
||||||
find_package(Qt6 REQUIRED COMPONENTS Core Widgets)
|
find_package(Qt6 REQUIRED COMPONENTS Core Widgets)
|
||||||
qt_standard_project_setup()
|
qt_standard_project_setup()
|
||||||
qt_add_executable(isle-config WIN32
|
qt_add_executable(config WIN32
|
||||||
LEGO1/mxdirectx/mxdirectxinfo.cpp
|
LEGO1/mxdirectx/mxdirectxinfo.cpp
|
||||||
LEGO1/mxdirectx/legodxinfo.cpp
|
LEGO1/mxdirectx/legodxinfo.cpp
|
||||||
CONFIG/config.cpp
|
CONFIG/config.cpp
|
||||||
@ -544,22 +533,22 @@ if (ISLE_BUILD_CONFIG)
|
|||||||
CONFIG/res/config.rc
|
CONFIG/res/config.rc
|
||||||
CONFIG/res/config.qrc
|
CONFIG/res/config.qrc
|
||||||
)
|
)
|
||||||
target_link_libraries(isle-config PRIVATE Qt6::Core Qt6::Widgets)
|
target_link_libraries(config PRIVATE Qt6::Core Qt6::Widgets)
|
||||||
set_property(TARGET isle-config PROPERTY AUTOMOC ON)
|
set_property(TARGET config PROPERTY AUTOMOC ON)
|
||||||
set_property(TARGET isle-config PROPERTY AUTORCC ON)
|
set_property(TARGET config PROPERTY AUTORCC ON)
|
||||||
set_property(TARGET isle-config PROPERTY AUTOUIC ON)
|
set_property(TARGET config PROPERTY AUTOUIC ON)
|
||||||
set_property(TARGET isle-config PROPERTY AUTOUIC_SEARCH_PATHS "${CMAKE_CURRENT_SOURCE_DIR}/CONFIG/res")
|
set_property(TARGET config PROPERTY AUTOUIC_SEARCH_PATHS "${CMAKE_CURRENT_SOURCE_DIR}/CONFIG/res")
|
||||||
list(APPEND isle_targets isle-config)
|
list(APPEND isle_targets config)
|
||||||
target_compile_definitions(isle-config PRIVATE _AFXDLL MXDIRECTX_FOR_CONFIG)
|
target_compile_definitions(config PRIVATE _AFXDLL MXDIRECTX_FOR_CONFIG)
|
||||||
target_include_directories(isle-config PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/LEGO1")
|
target_include_directories(config PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/LEGO1")
|
||||||
target_include_directories(isle-config PUBLIC "$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/util>")
|
target_include_directories(config PUBLIC "$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/util>")
|
||||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 14)
|
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 14)
|
||||||
target_link_libraries(isle-config PRIVATE DirectX5::DirectX5)
|
target_link_libraries(config PRIVATE DirectX5::DirectX5)
|
||||||
endif()
|
endif()
|
||||||
target_compile_definitions(isle-config PRIVATE DIRECT3D_VERSION=0x500)
|
target_compile_definitions(config PRIVATE DIRECT3D_VERSION=0x500)
|
||||||
target_link_libraries(isle-config PRIVATE SDL3::SDL3 Isle::iniparser)
|
target_link_libraries(config PRIVATE SDL3::SDL3 iniparser-static)
|
||||||
if (NOT ISLE_MINIWIN)
|
if (NOT ISLE_MINIWIN)
|
||||||
target_link_libraries(isle-config PRIVATE ddraw dxguid)
|
target_link_libraries(config PRIVATE ddraw dxguid)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@ -573,8 +562,8 @@ if (MSVC)
|
|||||||
if (TARGET isle)
|
if (TARGET isle)
|
||||||
target_compile_definitions(isle PRIVATE "_CRT_SECURE_NO_WARNINGS")
|
target_compile_definitions(isle PRIVATE "_CRT_SECURE_NO_WARNINGS")
|
||||||
endif()
|
endif()
|
||||||
if (TARGET isle-config)
|
if (TARGET config)
|
||||||
target_compile_definitions(isle-config PRIVATE "_CRT_SECURE_NO_WARNINGS")
|
target_compile_definitions(config PRIVATE "_CRT_SECURE_NO_WARNINGS")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
# Visual Studio 2017 version 15.7 needs "/Zc:__cplusplus" for __cplusplus
|
# Visual Studio 2017 version 15.7 needs "/Zc:__cplusplus" for __cplusplus
|
||||||
@ -583,8 +572,8 @@ if (MSVC)
|
|||||||
if (TARGET isle)
|
if (TARGET isle)
|
||||||
target_compile_options(isle PRIVATE "-Zc:__cplusplus")
|
target_compile_options(isle PRIVATE "-Zc:__cplusplus")
|
||||||
endif()
|
endif()
|
||||||
if (TARGET isle-config)
|
if (TARGET config)
|
||||||
target_compile_options(isle-config PRIVATE "-Zc:__cplusplus")
|
target_compile_options(config PRIVATE "-Zc:__cplusplus")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
@ -633,18 +622,29 @@ else()
|
|||||||
include(GNUInstallDirs)
|
include(GNUInstallDirs)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
string(REPLACE ";" "-" ISLE_CPUS_STRING "${ISLE_CPUS}")
|
set(ISLE_PACKAGE_NAME "${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}" CACHE STRING "Platform name of the package")
|
||||||
string(TOLOWER "${ISLE_CPUS_STRING}" ISLE_CPUS_STRING)
|
|
||||||
set(ISLE_PACKAGE_NAME "${CMAKE_SYSTEM_NAME}-${ISLE_CPUS_STRING}" CACHE STRING "Platform name of the package")
|
|
||||||
if(BUILD_SHARED_LIBS)
|
if(BUILD_SHARED_LIBS)
|
||||||
list(APPEND install_extra_targets lego1)
|
list(APPEND install_extra_targets lego1)
|
||||||
endif()
|
endif()
|
||||||
install(TARGETS isle ${install_extra_targets}
|
|
||||||
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
|
|
||||||
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
|
||||||
)
|
|
||||||
if (ISLE_BUILD_CONFIG)
|
if (ISLE_BUILD_CONFIG)
|
||||||
install(TARGETS isle-config
|
find_program(WINDEPLOYQT_EXECUTABLE windeployqt)
|
||||||
|
if(WINDEPLOYQT_EXECUTABLE)
|
||||||
|
add_custom_command(TARGET config POST_BUILD
|
||||||
|
COMMAND "${WINDEPLOYQT_EXECUTABLE}"
|
||||||
|
"$<TARGET_FILE:config>"
|
||||||
|
"--libdir"
|
||||||
|
"${CMAKE_INSTALL_LIBDIR}"
|
||||||
|
"--no-compiler-runtime"
|
||||||
|
"--no-opengl-sw"
|
||||||
|
"--no-system-d3d-compiler"
|
||||||
|
"--no-translations"
|
||||||
|
"--no-quick-import"
|
||||||
|
COMMENT "Running windeployqt with minimal dependencies"
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
message(WARNING "windeployqt not found.")
|
||||||
|
endif()
|
||||||
|
install(TARGETS config
|
||||||
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
|
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
@ -653,29 +653,15 @@ if(EMSCRIPTEN)
|
|||||||
DESTINATION "${CMAKE_INSTALL_BINDIR}"
|
DESTINATION "${CMAKE_INSTALL_BINDIR}"
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
install(TARGETS isle ${install_extra_targets}
|
||||||
add_subdirectory(packaging)
|
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
|
||||||
|
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||||
|
)
|
||||||
set(CPACK_PACKAGE_DIRECTORY "dist")
|
set(CPACK_PACKAGE_DIRECTORY "dist")
|
||||||
set(CPACK_PACKAGE_FILE_NAME "isle-${PROJECT_VERSION}-${ISLE_PACKAGE_NAME}")
|
set(CPACK_PACKAGE_FILE_NAME "isle-${PROJECT_VERSION}-${ISLE_PACKAGE_NAME}-${CMAKE_SYSTEM_PROCESSOR}")
|
||||||
if(NINTENDO_3DS)
|
|
||||||
ctr_generate_smdh(isle.smdh
|
|
||||||
NAME "LEGO Island"
|
|
||||||
TITLE "LEGO Island"
|
|
||||||
DESCRIPTION "LEGO Island for the Nintendo 3DS"
|
|
||||||
AUTHOR "isledecomp/isle-portable"
|
|
||||||
VERSION "${PROJECT_VERSION}"
|
|
||||||
ICON "ISLE/res/3ds/isle.png"
|
|
||||||
)
|
|
||||||
|
|
||||||
ctr_create_3dsx(isle SMDH isle.smdh)
|
|
||||||
install(FILES "$<TARGET_FILE_DIR:isle>/isle.3dsx" DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
|
||||||
endif()
|
|
||||||
if(WIN32)
|
|
||||||
install(DIRECTORY "$<TARGET_FILE_DIR:isle>/QTLibs" DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
|
||||||
endif()
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
set(CPACK_GENERATOR ZIP)
|
set(CPACK_GENERATOR ZIP)
|
||||||
else()
|
else()
|
||||||
set(CPACK_GENERATOR TGZ)
|
set(CPACK_GENERATOR TGZ)
|
||||||
endif()
|
endif()
|
||||||
|
include(CPack)
|
||||||
Loading…
Reference in New Issue
Block a user