mirror of https://github.com/InoriRus/Kyty.git
Merge 1fdaa18f39
into e66461427e
This commit is contained in:
commit
c2a0edc53b
|
@ -8,8 +8,8 @@ on:
|
|||
- '*'
|
||||
concurrency: ci-${{ github.ref }}
|
||||
jobs:
|
||||
build:
|
||||
name: Build
|
||||
build-windows:
|
||||
name: Build (Windows)
|
||||
runs-on: windows-2022
|
||||
steps:
|
||||
- name: Checkout source
|
||||
|
@ -43,5 +43,21 @@ jobs:
|
|||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: Kyty
|
||||
name: Kyty (Windows)
|
||||
path: _Build/_Gcc/_bin
|
||||
build-linux:
|
||||
name: Build (Linux)
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Checkout source
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
lfs: true
|
||||
- name: Install Ubuntu packages
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y qt5-default qttools5-dev
|
||||
- name: Run CMake
|
||||
run: cmake -B _Build/_Linux -S source -D CMAKE_BUILD_TYPE=Release -D KYTY_FINAL=1
|
||||
- name: Build
|
||||
run: cmake --build _Build/_Linux
|
||||
|
|
|
@ -2,10 +2,6 @@ cmake_minimum_required(VERSION 3.12)
|
|||
|
||||
project(Kyty)
|
||||
|
||||
if (NOT (WIN32 AND (MINGW OR MSVC)))
|
||||
message(FATAL_ERROR "only mingw and msvc supported")
|
||||
endif()
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
|
@ -43,8 +39,7 @@ else()
|
|||
set(KYTY_BUILD KYTY_BUILD_RELEASE)
|
||||
endif()
|
||||
|
||||
set(KYTY_PLATFORM KYTY_PLATFORM_WINDOWS)
|
||||
|
||||
# Platform-specific configurations.
|
||||
if(MINGW)
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "(C|c?)lang")
|
||||
set(CLANG 1)
|
||||
|
@ -57,7 +52,10 @@ if(MINGW)
|
|||
set(KYTY_COMPILER MINGW)
|
||||
set(KYTY_LINKER LD)
|
||||
endif()
|
||||
else()
|
||||
|
||||
set(KYTY_PLATFORM KYTY_PLATFORM_WINDOWS)
|
||||
elseif(WIN32)
|
||||
# Assume it is MSVC if we are on Windows with non-MinGW.
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "(C|c?)lang")
|
||||
set(CLANG 1)
|
||||
set(KYTY_COMPILER CLANG)
|
||||
|
@ -66,6 +64,14 @@ else()
|
|||
set(KYTY_COMPILER MSVC)
|
||||
set(KYTY_LINKER LINK)
|
||||
endif()
|
||||
|
||||
set(KYTY_PLATFORM KYTY_PLATFORM_WINDOWS)
|
||||
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
||||
set(KYTY_COMPILER GCC)
|
||||
set(KYTY_LINKER LD)
|
||||
set(KYTY_PLATFORM KYTY_PLATFORM_LINUX)
|
||||
else()
|
||||
message(FATAL_ERROR "The target platform is not supported")
|
||||
endif()
|
||||
|
||||
set(KYTY_PROJECT_NAME "Emulator" CACHE STRING "Project name")
|
||||
|
|
|
@ -45,28 +45,32 @@ endif()
|
|||
|
||||
add_dependencies(launcher KytyGitVersion)
|
||||
|
||||
find_program(QT_WINDEPLOYQT NAMES windeployqt PATHS "${Qt5_DIR}/../../../bin")
|
||||
if(NOT QT_WINDEPLOYQT)
|
||||
message(FATAL_ERROR "Could not find windeployqt")
|
||||
endif()
|
||||
|
||||
set(launcher_name "launcher")
|
||||
|
||||
set_target_properties(launcher PROPERTIES OUTPUT_NAME ${launcher_name})
|
||||
|
||||
install(TARGETS launcher DESTINATION .)
|
||||
|
||||
install(CODE "
|
||||
execute_process(
|
||||
COMMAND ${QT_WINDEPLOYQT} \"\${CMAKE_INSTALL_PREFIX}/${launcher_name}.exe\"
|
||||
--no-svg
|
||||
--no-angle
|
||||
--no-opengl
|
||||
--no-opengl-sw
|
||||
--no-system-d3d-compiler
|
||||
--no-translations
|
||||
)
|
||||
")
|
||||
if(WIN32)
|
||||
find_program(QT_WINDEPLOYQT NAMES windeployqt PATHS "${Qt5_DIR}/../../../bin")
|
||||
|
||||
if(NOT QT_WINDEPLOYQT)
|
||||
message(FATAL_ERROR "Could not find windeployqt")
|
||||
endif()
|
||||
|
||||
install(CODE "
|
||||
execute_process(
|
||||
COMMAND ${QT_WINDEPLOYQT} \"\${CMAKE_INSTALL_PREFIX}/${launcher_name}.exe\"
|
||||
--no-svg
|
||||
--no-angle
|
||||
--no-opengl
|
||||
--no-opengl-sw
|
||||
--no-system-d3d-compiler
|
||||
--no-translations
|
||||
)
|
||||
")
|
||||
endif()
|
||||
|
||||
|
||||
|
||||
qt5_create_translation(QM_FILES ${launcher_src} ${launcher_forms} ${launcher_ts} OPTIONS -I ${CMAKE_SOURCE_DIR}/launcher/include)
|
||||
|
|
Loading…
Reference in New Issue