Skip to content

Commit

Permalink
cmake: Add a patch to fix a regression since CMake 3.18
Browse files Browse the repository at this point in the history
This fixes all CMake builds that use target_precompile_headers() and
as a result fail since CMake 3.18 with e.g.:
g++: error: unrecognized command line option '-Xarch_x86_64'; did you mean '-march=x86-64'?

Fix #94905.

CMake references:
- https://gitlab.kitware.com/cmake/cmake/-/issues/21072
- https://gitlab.kitware.com/cmake/cmake/-/merge_requests/5118
  • Loading branch information
primeos committed Aug 13, 2020
1 parent 7e189c5 commit 57f0574
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkgs/development/tools/build-managers/cmake/default.nix
@@ -1,4 +1,4 @@
{ stdenv, lib, fetchurl, pkgconfig
{ stdenv, lib, fetchurl, pkgconfig, fetchpatch
, bzip2, curl, expat, libarchive, xz, zlib, libuv, rhash
, buildPackages
# darwin attributes
Expand Down Expand Up @@ -37,6 +37,12 @@ stdenv.mkDerivation rec {
# Derived from https://github.com/libuv/libuv/commit/1a5d4f08238dd532c3718e210078de1186a5920d
./libuv-application-services.patch

# TODO: Remove this patch for a regression once CMake 3.18.2 is out:
(fetchpatch { # PCH: Avoid Apple-specific architecture flags on other platforms
url = "https://gitlab.kitware.com/cmake/cmake/-/commit/70ce1ad64a04a244bb1c03753da0752c61fc3a37.patch";
sha256 = "0jcdgv48j0dd4nlhyy3j0s3h6bcbrq2yg1mdhpgfqrb2y3p91fky";
})

] ++ lib.optional stdenv.isCygwin ./3.2.2-cygwin.patch;

outputs = [ "out" ];
Expand Down

0 comments on commit 57f0574

Please sign in to comment.