fix windows build, changed github actions to remove Qt steps

This commit is contained in:
Anthony Rabine 2023-12-24 14:41:14 +01:00
parent a730ea4e0b
commit 7c4b6dd418
4 changed files with 13 additions and 31 deletions

View file

@ -5,9 +5,6 @@ on:
push:
branches:
- main
env:
QT_VERSION: 6.5.1
jobs:
build_win:
runs-on: windows-latest
@ -15,36 +12,21 @@ jobs:
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: ilammy/msvc-dev-cmd@v1
- uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: install_deps
run : |
choco install wget -y
choco install nsis -y
choco install ninja -y
choco install cmake -y
pip install aqtinstall
- name: install_qt
run : |
python3 -m aqt install-qt -m qtmultimedia -O ${{ github.workspace }}/Qt/ windows desktop ${{ env.QT_VERSION }} win64_msvc2019_64
echo "${{ github.workspace }}/Qt/${{ env.QT_VERSION }}/msvc2019_64/bin/" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: build
working-directory: ./story-editor
run : |
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=${{ github.workspace }}\Qt\${{ env.QT_VERSION }}\msvc2019_64 -DQT_DIR=${{ github.workspace }}\Qt\6.5.1\msvc2019_64\lib\cmake\Qt6 -G Ninja ..
cmake -DCMAKE_BUILD_TYPE=Release -G Ninja ..
ninja
ls
mkdir story-editor
cp story-editor.exe story-editor
windeployqt story-editor/story-editor.exe --release
copy C:\Windows\System32\vccorlib140.dll story-editor\
copy C:\Windows\System32\msvcp140.dll story-editor\
copy C:\Windows\System32\vcruntime140.dll story-editor\
${{ github.workspace }}/Qt/${{ env.QT_VERSION }}/msvc2019_64/bin/windeployqt.exe --release --no-compiler-runtime --no-opengl-sw --no-system-d3d-compiler story-editor\story-editor.exe
- name: package_setup
working-directory: ./story-editor
run : |

View file

@ -12,11 +12,6 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
# set(CMAKE_VERBOSE_MAKEFILE on)
if (MSVC)
add_compile_options("/FS")
endif (MSVC)
if(POLICY CMP0072)
cmake_policy(SET CMP0072 NEW)
endif()
@ -167,7 +162,7 @@ set(SRCS
if(WIN32)
list(APPEND
SRCS
manolab/icon.rc
icon.rc
)
endif()
@ -207,13 +202,17 @@ target_link_libraries(${STORY_EDITOR_PROJECT}
SDL2
)
elseif(WIN32)
target_compile_features("-Wl,-subsystem,windows")
target_link_libraries(${STORY_EDITOR_PROJECT}
icl
OpenGL::GL
# SDL2::SDL2main
SDL2::SDL2-static
ws2_32.lib psapi.lib setupapi.lib cfgmgr32.lib advapi32.lib Dbghelp.lib
)
set_target_properties(${STORY_EDITOR_PROJECT} PROPERTIES
LINK_FLAGS /SUBSYSTEM:CONSOLE
)
#set_target_properties(${STORY_EDITOR_PROJECT} PROPERTIES
#LINK_FLAGS /SUBSYSTEM:CONSOLE
#)
endif()

View file

@ -426,7 +426,8 @@ void MainWindow::NewProjectPopup()
if (valid)
{
m_project.Initialize(std::filesystem::path(projdir) / "project.json");
auto p = std::filesystem::path(projdir) / std::filesystem::path("project.json");
m_project.Initialize(p.generic_string());
if (display_item_current_idx == 0)
{

View file

@ -44,7 +44,7 @@ void ResourcesWindow::ChooseFile()
std::filesystem::path p(filePathName);
std::filesystem::path p2 = m_project.BuildFullAssetsPath( p.filename());
std::filesystem::path p2 = m_project.BuildFullAssetsPath( p.filename().generic_string());
std::filesystem::copy(p, p2, std::filesystem::copy_options::overwrite_existing);
auto res = std::make_shared<Resource>();