Search Criteria
Package Details: mingw-w64-cmake 1-40
Package Actions
Git Clone URL: | https://aur.archlinux.org/mingw-w64-cmake.git (read-only, click to copy) |
---|---|
Package Base: | mingw-w64-cmake |
Description: | CMake wrapper for MinGW (mingw-w64) |
Upstream URL: | http://fedoraproject.org/wiki/MinGW |
Licenses: | GPL |
Submitter: | brcha |
Maintainer: | xantares |
Last Packager: | xantares |
Votes: | 56 |
Popularity: | 0.000121 |
First Submitted: | 2013-04-17 12:11 (UTC) |
Last Updated: | 2022-12-05 17:39 (UTC) |
Dependencies (5)
- cmake (cmake-gitAUR)
- mingw-w64-environmentAUR (llvm-mingw-w64-environmentAUR)
- mingw-w64-gcc (mingw-w64-gcc132AUR, llvm-mingw-w64-toolchain-msvcrt-binAUR, llvm-mingw-w64-toolchain-ucrt-binAUR)
- mingw-w64-pkg-configAUR (llvm-mingw-w64-pkg-configAUR)
- mingw-w64-wineAUR (optional) – runtime support
Required by (271)
- mingw-w64-abseil-cpp (make)
- mingw-w64-agrum (make)
- mingw-w64-aom (make)
- mingw-w64-armadillo (make)
- mingw-w64-asmjit (make)
- mingw-w64-assimp (make)
- mingw-w64-async++-git (make)
- mingw-w64-avisynthplus (make)
- mingw-w64-blas (make)
- mingw-w64-blosc (make)
- mingw-w64-box2d (make)
- mingw-w64-brotli (make)
- mingw-w64-bullet (make)
- mingw-w64-c++utilities (make)
- mingw-w64-c-ares (make)
- mingw-w64-capstone (make)
- mingw-w64-catch2v3 (make)
- mingw-w64-cblas (make)
- mingw-w64-ceres-solver (make)
- mingw-w64-cfitsio (make)
- Show 251 more...
Latest Comments
« First ‹ Previous 1 2 3 4 5 6 7 8 9 Next › Last »
hhromic commented on 2019-12-03 11:56 (UTC)
@xantares thanks for working on this, appreciated.
I tested again now and it works!
Release
builds do have the-DNDEBUG
define from the default CMake flags. The builds also work fine.However I noticed that CMake also defaults to adding
-O3
optimisation toRelease
builds and the mingw-w64 flags (now inmingw-w64-environment
) seem to be wanting to use-O2
optimisation. This results in the following compiler flags for the build:The manpage of
gcc
states that when you use multiple-O
flags the last takes precedence, meaning that the build ends up using-O3
. If-O3
is known to be problematic for mingw-w64 builds then this might become a problem.Maybe this was the original reason why you were previously forcing the C/CXX flags? Defaulting to
-O3
seems to be a bit of a controversial topic in CMake help forums and Stack Overflow but is has been the default for years, even pre-CMake 3.0). Perhaps-O3
is not much of an issue nowadays? I'm not an expert in this field so can't state strong conclusions.If
-O2
is strictly required for mingw-w64 builds then we need to work out a way to remove the default-O3
from theCMAKE_${lang}_FLAGS_RELEASE_INIT
variables set by the CMake's GNU compiler module in a clean manner.A potential solution that I think would be good is to find a way to append (in contrast to prepend) the flags from
mingw-w64-environment
so they get inserted after the defaults from CMake and thus-O2
will take precedence.I think this could be done cleanly in the mingw toolchain file. In this case we should make sure to not export the
*_FLAGS
variables (that get prepended) but instead code them in the toolchain file.What do you think?
xantares commented on 2019-12-03 09:19 (UTC) (edited on 2019-12-03 09:19 (UTC) by xantares)
@hhromic can you test the new version ? I removed CMAKE_BUILD_TYPE and CMAKE_*_FLAGS_RELEASE, plus the flags are now taken from an env package
hhromic commented on 2019-12-02 09:07 (UTC) (edited on 2019-12-02 11:40 (UTC) by hhromic)
Fwiw, I've been testing the wrapper with removed
-DCMAKE_BUILD_TYPE=Release
and all-DCMAKE_*_FLAGS_RELEASE
flags in the project I'm working on and all seems to be behaving as expected.I fully agree that if there is any package requiring those, it should be fixed in said package and not in this generic wrapper. The wrapper should be as thin as possible for maximum compatibility, i.e. only set required paths and the toolchain.
Let me know if you would like me to do specific tests. Happy to help.
Martchus commented on 2019-12-01 21:04 (UTC)
No and unfortunately you left no information in the commit messages why you're enforcing the build type release and made it override the build type's flags:
1e9e4690c2ed
3174bb8705e8
The regular packages don't enforce a build type and rely on CMake picking up the CFLAGS/CXXFLAGS/LDFLAGS env variables. We could revert the script to do the same and see what happens. If only a few packages are affected it might make more sense to fix these than overriding all the flags in the generic wrapper.
xantares commented on 2019-12-01 20:16 (UTC)
@martchus do you recall why we set CMAKE_CXX_FLAGS_RELEASE and such ?
it seems CXXFLAGS/LDFLAGS are enough, as the flags appear twice
hhromic commented on 2019-12-01 11:42 (UTC) (edited on 2019-12-02 10:54 (UTC) by hhromic)
Hi all, I noticed that the standard
NDEBUG
define for disabling debug and assertions is not being set by this CMake wrapper when the build type isRelease
(expected behaviour).I went to debug a bit and the wrapper is doing this:
Which seems to be forcing specific C/CXX/LD flags to the
Release
build type and the C/CXX flags do not indeed contain-DNDEBUG
.This seems to be breaking the expected behaviour done by upstream CMake. For instance for the GNU compilers: https://github.com/Kitware/CMake/blob/master/Modules/Compiler/GNU.cmake#L58
Isn't CMake able to automatically pick (and add instead of replace) all the
$CFLAGS
,$CXXFLAGS
,$LDFLAGS
from the environment without the need to explicitly set them usingCMAKE_*_FLAGS
variables?I tested removing these variables in the wrapper and CMake correctly picked the defined e.g.
default_mingw_compiler_flags
and correctly kept the-DNDEBUG
and-O3
flags forRelease
in the resultingCFLAGS
andCXXFLAGS
for the project I'm working on:As additional info, the native Linux
cmake
package does keep-DNDEBUG -O3
when the build is set toRelease
.What do you think? Thanks!
xantares commented on 2019-11-10 12:10 (UTC)
the new mingw runtime 7.0.0 now supports FORTIFY_SOURCE, but you get undefined references to __chk functions from libssp now
you can see the discussion in mingw-w64-configure
Martchus commented on 2019-11-10 12:08 (UTC)
Why did you change
_FORTIFY_SOURCE=0
?hhromic commented on 2019-10-16 22:51 (UTC)
Hi again, I think I figured it out now. The variable I need to use is
CMAKE_STAGING_PREFIX
, which is used for cross-compiling environment such as this package. I tested and does exactly what I needed.Thanks anyway!
hhromic commented on 2019-10-16 21:30 (UTC)
Hi guys, First of all, thank you very much for putting together this wrapper package. Is simply amazing and makes things so easy to use!
However I'm having trouble setting
CMAKE_INSTALL_PREFIX
in my builds. When I set this variable, theCMAKE_SYSTEM_PREFIX_PATH
ends up wrong and things likefind_path()
stop working. For example:No install prefix provided, default is
/usr/x86_64-w64-mingw32
:Install prefix provided
-DCMAKE_INSTALL_PREFIX=/tmp/install
:As you can see, the system path
/usr/x86_64-w64-mingw32
is not present anymore and of coursefind_path()
doesn't find things correctly.I noticed that in other environments such as MSYS2 or standard cmake, things work as expected. For example in standard cmake in ArchLinux:
No install prefix provided, default:
/usr/local
:Install prefix provided
-DCMAKE_INSTALL_PREFIX=/tmp/install
:As you can see, the system path
/usr/local
is actually duplicated, therefore if you change the defaultCMAKE_INSTALL_PREFIX
it doesn't break.Now, I noticed that in the mingw-w64-cmake package, the wrapper
mingw-cmake.sh
actually passesCMAKE_INSTALL_PREFIX=${mingw_prefix}
and providing it externally actually overrides it. Therefore, explaining the issue.With all that, I would kindly like to ask how I'm supposed to set a custom
CMAKE_INSTALL_PREFIX
of my own with this mingw-w64-cmake package?Is this a short-coming of the wrapper? Thanks!
« First ‹ Previous 1 2 3 4 5 6 7 8 9 Next › Last »