mirror of
https://github.com/arabine/open-story-teller.git
synced 2025-12-06 17:09:06 +01:00
fix windows build, new build script for win32 setup executable generation
This commit is contained in:
parent
8581dbf253
commit
37d79c5e33
9 changed files with 61 additions and 61 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -77,3 +77,5 @@ story-editor/.idea/
|
||||||
story-editor/buildxcode/
|
story-editor/buildxcode/
|
||||||
|
|
||||||
story-editor/cmake-build-debug/
|
story-editor/cmake-build-debug/
|
||||||
|
|
||||||
|
story-editor/build-win32/
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
#include <thread>
|
#include <thread>
|
||||||
#include <condition_variable>
|
#include <condition_variable>
|
||||||
#include <queue>
|
#include <queue>
|
||||||
|
#include <thread>
|
||||||
#include "thread_safe_queue.h"
|
#include "thread_safe_queue.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ void LibraryManager::Scan()
|
||||||
if (std::filesystem::is_directory(entry.path()))
|
if (std::filesystem::is_directory(entry.path()))
|
||||||
{
|
{
|
||||||
// Si c'est un sous-répertoire, récursivement scanner le contenu
|
// Si c'est un sous-répertoire, récursivement scanner le contenu
|
||||||
std::string uuid = entry.path().filename();
|
std::string uuid = entry.path().filename().generic_string();
|
||||||
if (UUID::IsValid(uuid))
|
if (UUID::IsValid(uuid))
|
||||||
{
|
{
|
||||||
std::cout << "Found story directory" << std::endl;
|
std::cout << "Found story directory" << std::endl;
|
||||||
|
|
|
||||||
|
|
@ -328,7 +328,7 @@ void StoryProject::SetDisplayFormat(int w, int h)
|
||||||
|
|
||||||
std::string StoryProject::GetProjectFilePath() const
|
std::string StoryProject::GetProjectFilePath() const
|
||||||
{
|
{
|
||||||
return m_project_file_path;
|
return m_project_file_path.generic_string();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string StoryProject::GetWorkingDir() const
|
std::string StoryProject::GetWorkingDir() const
|
||||||
|
|
|
||||||
|
|
@ -269,6 +269,9 @@ install_files("." FILES "${CMAKE_SOURCE_DIR}/tools/imgui.ini")
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
install_files("." FILES "${SDL2_BIN_DIR}/SDL2.dll")
|
install_files("." FILES "${SDL2_BIN_DIR}/SDL2.dll")
|
||||||
|
install_files("." FILES "/usr/lib/gcc/x86_64-w64-mingw32/10-posix/libstdc++-6.dll")
|
||||||
|
install_files("." FILES "/usr/x86_64-w64-mingw32/lib/libwinpthread-1.dll")
|
||||||
|
install_files("." FILES "/usr/lib/gcc/x86_64-w64-mingw32/10-posix/libgcc_s_seh-1.dll")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Personnaliser l'icône pour les installateurs Windows
|
# Personnaliser l'icône pour les installateurs Windows
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,21 @@
|
||||||
|
# Multi-stage Docker file
|
||||||
|
# 1) Developer environment
|
||||||
|
# 2) nginx stage to serve frontend assets
|
||||||
|
# This file must be run in the parent directory:
|
||||||
|
# docker build -t gridwatch-front -f dashboard/Dockerfile .
|
||||||
|
|
||||||
|
# =======================================================
|
||||||
|
# 1. Build stage, we need a node environment
|
||||||
|
# =======================================================
|
||||||
|
|
||||||
|
|
||||||
FROM ubuntu:22.04
|
FROM ubuntu:22.04
|
||||||
LABEL Description="Build environment"
|
LABEL Description="Developer environment"
|
||||||
|
|
||||||
ENV HOME /root
|
ENV HOME /root
|
||||||
|
|
||||||
SHELL ["/bin/bash", "-c"]
|
SHELL ["/bin/bash", "-c"]
|
||||||
|
|
||||||
RUN mkdir /workspace
|
|
||||||
|
|
||||||
RUN apt-get update && apt-get -y --no-install-recommends install \
|
RUN apt-get update && apt-get -y --no-install-recommends install \
|
||||||
build-essential \
|
build-essential \
|
||||||
cmake \
|
cmake \
|
||||||
|
|
@ -14,3 +23,11 @@ RUN apt-get update && apt-get -y --no-install-recommends install \
|
||||||
mingw-w64 \
|
mingw-w64 \
|
||||||
git \
|
git \
|
||||||
wget
|
wget
|
||||||
|
|
||||||
|
# Make sure to use the POSIX version of MinGW:
|
||||||
|
# Manual equivalent command is : update-alternatives --config x86_64-w64-mingw32-g++
|
||||||
|
|
||||||
|
RUN update-alternatives --set x86_64-w64-mingw32-g++ $(update-alternatives --list x86_64-w64-mingw32-g++ | grep posix)
|
||||||
|
RUN update-alternatives --set x86_64-w64-mingw32-gcc $(update-alternatives --list x86_64-w64-mingw32-gcc | grep posix)
|
||||||
|
|
||||||
|
RUN mkdir /workspace
|
||||||
|
|
|
||||||
|
|
@ -2,64 +2,19 @@
|
||||||
|
|
||||||
## How to generate a Windows executable and setup executable on Ubuntu
|
## How to generate a Windows executable and setup executable on Ubuntu
|
||||||
|
|
||||||
All the commands listed here are invoked from this `story-editor` root directory.
|
The build system uses a Docker environment image for reproductible builds.
|
||||||
Make sure to have Docker installed:
|
|
||||||
|
Run `build_win32.sh` script.
|
||||||
```
|
|
||||||
sudo apt install docker.io
|
Output file is located here: `story-editor/build-win32/Open-Story-Editor-1.0.0-win64.exe`
|
||||||
```
|
|
||||||
|
## Linux build
|
||||||
Build the Docker image that contains all the necessary development tools:
|
|
||||||
|
|
||||||
```
|
|
||||||
docker build -t cpp-dev .
|
|
||||||
```
|
|
||||||
|
|
||||||
Run it:
|
|
||||||
|
|
||||||
```
|
|
||||||
docker run -it -v $(pwd)/..:/workspace cpp-dev
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
Make sure to use the POSIX version of MinGW:
|
|
||||||
|
|
||||||
```
|
|
||||||
update-alternatives --config x86_64-w64-mingw32-g++
|
|
||||||
|
|
||||||
|
|
||||||
Selection Path Priority Status
|
|
||||||
------------------------------------------------------------
|
|
||||||
0 /usr/bin/x86_64-w64-mingw32-g++-win32 60 auto mode
|
|
||||||
* 1 /usr/bin/x86_64-w64-mingw32-g++-posix 30 manual mode
|
|
||||||
2 /usr/bin/x86_64-w64-mingw32-g++-win32 60 manual mode
|
|
||||||
|
|
||||||
|
|
||||||
update-alternatives --config x86_64-w64-mingw32-gcc
|
|
||||||
|
|
||||||
Selection Path Priority Status
|
|
||||||
------------------------------------------------------------
|
|
||||||
0 /usr/bin/x86_64-w64-mingw32-gcc-win32 60 auto mode
|
|
||||||
* 1 /usr/bin/x86_64-w64-mingw32-gcc-posix 30 manual mode
|
|
||||||
2 /usr/bin/x86_64-w64-mingw32-gcc-win32 60 manual mode
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
Cross build, first generate the Makefile:
|
|
||||||
|
|
||||||
```
|
|
||||||
git config --global http.sslverify false # avoid error during clone
|
|
||||||
cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/mingw-w64-x86_64.cmake ..
|
|
||||||
```
|
|
||||||
|
|
||||||
Then build the executable and then the installer:
|
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
cd story-editor
|
||||||
|
mkdir build
|
||||||
|
cd build
|
||||||
|
cmake ..
|
||||||
make -j4
|
make -j4
|
||||||
make package
|
make package
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
11
story-editor/build_win32.sh
Executable file
11
story-editor/build_win32.sh
Executable file
|
|
@ -0,0 +1,11 @@
|
||||||
|
docker build -t cpp-dev .
|
||||||
|
docker run -it \
|
||||||
|
-v $(pwd)/..:/workspace \
|
||||||
|
cpp-dev \
|
||||||
|
bash \
|
||||||
|
-c "mkdir -p /workspace/story-editor/build-win32 && \
|
||||||
|
cd /workspace/story-editor/build-win32 && \
|
||||||
|
git config --global http.sslverify false && \
|
||||||
|
cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/mingw-w64-x86_64.cmake .. && \
|
||||||
|
make && \
|
||||||
|
make package"
|
||||||
|
|
@ -121,6 +121,17 @@ namespace pf
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namesapce internal
|
} // namesapce internal
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
std::string getExecutablePath()
|
||||||
|
{
|
||||||
|
char path[MAX_PATH];
|
||||||
|
DWORD length = GetModuleFileName(NULL, path, MAX_PATH);
|
||||||
|
return std::string(path);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} // namespace pf
|
} // namespace pf
|
||||||
|
|
||||||
class FreeCoTaskMemory
|
class FreeCoTaskMemory
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue