Open mgrinzPlayer opened 4 years ago
I already have some platform-specific instructions at https://constexpr.org/innoextract/install - these could be added there.
However I have a couple of questions:
ln -s /mingw32/bin/mingw32-make.exe /mingw32/bin/make.exe
Why not just call mingw32-make.exe
directly? No need to ask users to create a mess in their installs.
-DUSE_LTO=OFF
Why do you need this? Does LTO not work for you? The MSYS2 package seems to not need to disable it.
-DUSE_STATIC_LIBS=ON
This is enabled by default on Windows - is this not the case for you?
-DCMAKE_EXE_LINKER_FLAGS=-static
Does this actually change anything for you? USE_STATIC_LIBS already enables -static-libstdc++
and -static-libgcc
. The resulting executable should only need msvcrt.dll and and Win32 system DLLs that are available on all installs.
-DCMAKE_BUILD_TYPE=Release
This should also not make any difference as the innoextract CMake script sets the build type to Release when not set by the user.
cmake -G"MSYS Makefiles" ..
Should be a sane default unless you have very specific requirements. If it isn't, it's better to fix that.
Thank you for your reply.
Why not just call mingw32-make.exe directly? No need to ask users to create a mess in their installs
I took this, not mandatory, step from other tutorials (e.g. from "Building EDuke32 on Windows" tutorial). I don't want to type mingw32-make
where I would normally type make
.
Does this actually change anything for you? USE_STATIC_LIBS already enables -static-libstdc++ and -static-libgcc. The resulting executable should only need msvcrt.dll and and Win32 system DLLs that are available on all installs.
Without -static
the resulting EXE will be using libwinpthread-1.dll
(it expects the DLL from msys2\mingw32\bin).
Why do you need this? Does LTO not work for you? The MSYS2 package seems to not need to disable it.
without -DUSE_LTO=OFF
I get linker/libboost errors:
with -DUSE_STATIC_LIBS=OFF -DUSE_LTO=ON
it compiles fine, of course resulting EXE needs those DLLs:
libgcc_s_dw2-1.dll
libstdc++-6.dll
libboost_filesystem-mt.dll
libboost_iostreams-mt.dll
libboost_program_options-mt.dll
liblzma-5.dll
Hi, I think it would be cool to add wiki pages with examples how to compile your project when someone is using MSYS2, VisualStudio, etc. Here's for MSYS2.
I'm using current MSYS2 (msys2-x86_64-20200720.exe installer, updated with
pacman -Syu
followed by fewpacman -Su
).Download recent innoextract source files to
~/innoextract
(e.g. C:\msys2\home\ {yourusername} \innoextract)32bit standalone executable
Launch MSYS2 with mingw32.exe. Install the needed packages (approx. +100MB to download, +1GB on disk):
pacman -S mingw-w64-i686-gcc mingw-w64-i686-make mingw-w64-i686-cmake mingw-w64-i686-boost
create symlink:
ln -s /mingw32/bin/mingw32-make.exe /mingw32/bin/make.exe
Execute this:
Then do
make -j8 && strip innoextract.exe
. You should get innoextract.exe inside build dir.64bit standalone executable
Launch MSYS2 with mingw64.exe, install packages:
pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-make mingw-w64-x86_64-cmake mingw-w64-x86_64-boost
create symlink:
ln -s /mingw64/bin/mingw32-make.exe /mingw64/bin/make.exe
Execute this:
Then do
make -j8 && strip innoextract.exe
. You should get innoextract.exe inside build-x64 dir.debuging
use
-DCMAKE_BUILD_TYPE=Debug
and don't usestrip
command.