cross-compile Windows
This commit is contained in:
parent
ec5705d94f
commit
3852dad8c9
1
.gitignore
vendored
1
.gitignore
vendored
@ -14,3 +14,4 @@
|
|||||||
!.gitignore
|
!.gitignore
|
||||||
!LICENSE
|
!LICENSE
|
||||||
!README.md
|
!README.md
|
||||||
|
!toolchain*.cmake
|
||||||
|
@ -1,22 +1,14 @@
|
|||||||
cmake_minimum_required(VERSION 3.16)
|
cmake_minimum_required(VERSION 3.16)
|
||||||
|
|
||||||
project(PunkLauncher VERSION 1.0.0 LANGUAGES CXX)
|
project(PunkLauncher VERSION 1.0.0 LANGUAGES CXX)
|
||||||
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/app)
|
||||||
if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
|
|
||||||
message(STATUS "In-source builds are not allowed. Please use a separate build directory.")
|
|
||||||
message(FATAL_ERROR "Please use a separate build directory: cd build & cmake ..")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(CMAKE_AUTORCC ON)
|
set(CMAKE_AUTORCC ON)
|
||||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||||
set(CMAKE_CXX_STANDARD 17)
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
|
||||||
find_package(LibArchive REQUIRED)
|
|
||||||
find_package(Qt6 REQUIRED COMPONENTS Widgets Network)
|
find_package(Qt6 REQUIRED COMPONENTS Widgets Network)
|
||||||
qt_standard_project_setup()
|
qt_standard_project_setup()
|
||||||
|
|
||||||
|
|
||||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/Linux-app)
|
|
||||||
|
|
||||||
add_subdirectory(src/app)
|
add_subdirectory(src/app)
|
||||||
|
@ -12,9 +12,13 @@ qt_add_executable(PunkLauncher
|
|||||||
target_link_libraries(PunkLauncher PRIVATE
|
target_link_libraries(PunkLauncher PRIVATE
|
||||||
Qt6::Widgets
|
Qt6::Widgets
|
||||||
Qt6::Network
|
Qt6::Network
|
||||||
LibArchive::LibArchive)
|
)
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
target_sources(PunkLauncher PRIVATE
|
||||||
|
../resources/app.rc
|
||||||
|
)
|
||||||
set_target_properties(PunkLauncher PROPERTIES
|
set_target_properties(PunkLauncher PROPERTIES
|
||||||
WIN32_EXECUTABLE ON
|
WIN32_EXECUTABLE ON
|
||||||
MACOSX_BUNDLE ON
|
|
||||||
)
|
)
|
||||||
|
endif()
|
||||||
|
BIN
src/resources/app.ico
Normal file
BIN
src/resources/app.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 96 KiB |
1
src/resources/app.rc
Normal file
1
src/resources/app.rc
Normal file
@ -0,0 +1 @@
|
|||||||
|
IDI_ICON1 ICON DISCARDABLE "app.ico"
|
@ -31,6 +31,10 @@
|
|||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>PunkLauncher</string>
|
<string>PunkLauncher</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="windowIcon">
|
||||||
|
<iconset resource="resources.qrc">
|
||||||
|
<normaloff>:/app.ico</normaloff>:/app.ico</iconset>
|
||||||
|
</property>
|
||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
<string notr="true">QFrame#border_top, QFrame#border_bottom, QFrame#border_left, QFrame#border_right {
|
<string notr="true">QFrame#border_top, QFrame#border_bottom, QFrame#border_left, QFrame#border_right {
|
||||||
/*background-color: rgb(217, 78, 108);*/
|
/*background-color: rgb(217, 78, 108);*/
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
<RCC>
|
<RCC>
|
||||||
<qresource prefix="/">
|
<qresource prefix="/">
|
||||||
<file>auth/logo.png</file>
|
<file>auth/logo.png</file>
|
||||||
|
<file>app.ico</file>
|
||||||
<file>main/selected_profile.png</file>
|
<file>main/selected_profile.png</file>
|
||||||
<file>main/settings_pressed_32x32.png</file>
|
<file>main/settings_pressed_32x32.png</file>
|
||||||
<file>main/settings_hover_32x32.png</file>
|
<file>main/settings_hover_32x32.png</file>
|
||||||
|
19
toolchain-win.cmake
Normal file
19
toolchain-win.cmake
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
set(CMAKE_SYSTEM_NAME Windows)
|
||||||
|
set(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc)
|
||||||
|
set(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++)
|
||||||
|
set(CMAKE_FIND_ROOT_PATH /home/xuy/x-tools/x86_64-w64-mingw32)
|
||||||
|
|
||||||
|
# Режим поиска зависимостей
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||||
|
|
||||||
|
# Библиотеки
|
||||||
|
set(CMAKE_PREFIX_PATH /opt/qt6-mingw ${CMAKE_PREFIX_PATH})
|
||||||
|
set(CMAKE_PREFIX_PATH /opt/deps/mingw ${CMAKE_PREFIX_PATH})
|
||||||
|
set(CMAKE_PREFIX_PATH /opt/deps/mingw-icu ${CMAKE_PREFIX_PATH})
|
||||||
|
|
||||||
|
# Статическая сборка
|
||||||
|
set(QT_STATIC ON)
|
||||||
|
set(DBUILD_SHARED_LIBS OFF)
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static -static-libgcc -static-libstdc++")
|
Loading…
Reference in New Issue
Block a user