From b99cae3931d23f522c61b37d9d0f737372f5bf0c Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Wed, 14 Mar 2018 14:20:07 -0500 Subject: [PATCH 1/4] cmake: set CMAKE_FIND_FRAMEWORK=last --- pkgs/development/tools/build-managers/cmake/setup-hook.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/development/tools/build-managers/cmake/setup-hook.sh b/pkgs/development/tools/build-managers/cmake/setup-hook.sh index c796c31cb70a..4607453867f2 100755 --- a/pkgs/development/tools/build-managers/cmake/setup-hook.sh +++ b/pkgs/development/tools/build-managers/cmake/setup-hook.sh @@ -44,6 +44,10 @@ cmakeConfigurePhase() { cmakeFlags="-DCMAKE_STRIP=$(command -v $crossConfig-strip) $cmakeFlags" fi + # on macOS we want to prefer Unix-style headers to Frameworks + # because we usually do not package the framework + cmakeFlags="-DCMAKE_FIND_FRAMEWORK=last $cmakeFlags" + # This installs shared libraries with a fully-specified install # name. By default, cmake installs shared libraries with just the # basename as the install name, which means that, on Darwin, they From acbf439fef3de30956f78118b69b2804c9d8dcc2 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Wed, 14 Mar 2018 14:30:10 -0500 Subject: [PATCH 2/4] cmake: disable detecting global macOS sdk --- pkgs/development/tools/build-managers/cmake/setup-hook.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/development/tools/build-managers/cmake/setup-hook.sh b/pkgs/development/tools/build-managers/cmake/setup-hook.sh index 4607453867f2..b7a4ab3d6f02 100755 --- a/pkgs/development/tools/build-managers/cmake/setup-hook.sh +++ b/pkgs/development/tools/build-managers/cmake/setup-hook.sh @@ -48,6 +48,9 @@ cmakeConfigurePhase() { # because we usually do not package the framework cmakeFlags="-DCMAKE_FIND_FRAMEWORK=last $cmakeFlags" + # we never want to use the global macOS SDK + cmakeFlags="-DCMAKE_OSX_SYSROOT= $cmakeFlags" + # This installs shared libraries with a fully-specified install # name. By default, cmake installs shared libraries with just the # basename as the install name, which means that, on Darwin, they From 8beb809fd1daca0f4e8b7807a05076ffbcc18c5f Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Wed, 14 Mar 2018 14:31:53 -0500 Subject: [PATCH 3/4] cmake: don't detect macOS deployment target --- pkgs/development/tools/build-managers/cmake/setup-hook.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/development/tools/build-managers/cmake/setup-hook.sh b/pkgs/development/tools/build-managers/cmake/setup-hook.sh index b7a4ab3d6f02..95822eec5920 100755 --- a/pkgs/development/tools/build-managers/cmake/setup-hook.sh +++ b/pkgs/development/tools/build-managers/cmake/setup-hook.sh @@ -51,6 +51,10 @@ cmakeConfigurePhase() { # we never want to use the global macOS SDK cmakeFlags="-DCMAKE_OSX_SYSROOT= $cmakeFlags" + # disable OSX deployment target + # we don't want our binaries to have a "minimum" OSX version + cmakeFlags="-DCMAKE_OSX_DEPLOYMENT_TARGET= $cmakeFlags" + # This installs shared libraries with a fully-specified install # name. By default, cmake installs shared libraries with just the # basename as the install name, which means that, on Darwin, they From bd9b17f762e22720612e8650737c3200b0dabb37 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Wed, 14 Mar 2018 14:36:27 -0500 Subject: [PATCH 4/4] cmake: correctly detect clang compiler on macOS --- pkgs/development/tools/build-managers/cmake/setup-hook.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/development/tools/build-managers/cmake/setup-hook.sh b/pkgs/development/tools/build-managers/cmake/setup-hook.sh index 95822eec5920..5053559bcca3 100755 --- a/pkgs/development/tools/build-managers/cmake/setup-hook.sh +++ b/pkgs/development/tools/build-managers/cmake/setup-hook.sh @@ -55,6 +55,9 @@ cmakeConfigurePhase() { # we don't want our binaries to have a "minimum" OSX version cmakeFlags="-DCMAKE_OSX_DEPLOYMENT_TARGET= $cmakeFlags" + # correctly detect our clang compiler + cmakeFlags="-DCMAKE_POLICY_DEFAULT_CMP0025=NEW $cmakeFlags" + # This installs shared libraries with a fully-specified install # name. By default, cmake installs shared libraries with just the # basename as the install name, which means that, on Darwin, they