Package Details: mingw-w64-cmake-static 1-2

Git Clone URL: https://aur.archlinux.org/mingw-w64-cmake-static.git (read-only, click to copy)
Package Base: mingw-w64-cmake-static
Description: CMake wrapper for MinGW (mingw-w64, static)
Upstream URL: https://github.com/martchus/pkgbuilds
Licenses: GPL
Submitter: Martchus
Maintainer: Martchus
Last Packager: Martchus
Votes: 2
Popularity: 0.000000
First Submitted: 2020-11-08 19:25 (UTC)
Last Updated: 2021-09-02 14:08 (UTC)

Pinned Comments

Martchus commented on 2021-08-11 12:45 (UTC) (edited on 2021-08-11 12:48 (UTC) by Martchus)

This package is mainly intended to achieve a statically linked build of Qt applications using the mingw-w64-qt6-*-static packages by preferring linking against static libraries (instead of dynamic libraries) and adding some workarounds (see also https://github.com/Martchus/PKGBUILDs#tested-build-and-deployment-tools-for-mingw-w64-qt6-packages).


Latest Comments

Martchus commented on 2022-06-27 23:43 (UTC) (edited on 2022-06-27 23:48 (UTC) by Martchus)

Adding a compiler flag globally which is only used by a single library isn't the nicest thing to do. I'd do it if there's no other way.

However, you could try to define these flags where the static library is used, similar to https://aur.archlinux.org/cgit/aur.git/tree/0003-Fix-using-static-PCRE2-and-DBus-1.patch?h=mingw-w64-qt6-base-static.

If pkgconfig is used, one can also set the corresponding variables like it is done for brotli (in https://aur.archlinux.org/cgit/aur.git/tree/toolchain-mingw-static.cmake?h=mingw-w64-cmake-static). When I remember correctly those are cache variables so you should be able to find the relevant variables by checking the CMake cache file.

If a CMake find module is used, then one can usually also override some variables.

Vaporeon commented on 2022-06-27 23:31 (UTC)

Do you mind adding these flags to the script?

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DFLAC__NO_DLL")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DFLAC__NO_DLL")

Current FLAC needs this defined or static linking will break. Not sure if this is in scope for this package or not. See [1].

[1] https://github.com/xiph/flac/issues/312

Martchus commented on 2021-08-11 12:45 (UTC) (edited on 2021-08-11 12:48 (UTC) by Martchus)

This package is mainly intended to achieve a statically linked build of Qt applications using the mingw-w64-qt6-*-static packages by preferring linking against static libraries (instead of dynamic libraries) and adding some workarounds (see also https://github.com/Martchus/PKGBUILDs#tested-build-and-deployment-tools-for-mingw-w64-qt6-packages).