Skip to content

Commit b75b322

Browse files
committed
Disable CPython shared library linking on macOS again
1 parent c11b0bc commit b75b322

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Formula/promod3.rb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,17 @@ class Promod3 < Formula
1717
def install
1818
if OS.mac?
1919
ENV.prepend "LDFLAGS", "-undefined dynamic_lookup -Wl,-export_dynamic"
20+
21+
# Disable linking directly to CPython shared libraries
22+
inreplace "cmake_support/PROMOD3.cmake",
23+
/^\s*set\(CMAKE_REQUIRED_FLAGS "\$\{CMAKE_REQUIRED_FLAGS\} \$\{Python_LIBRARIES\}"\)\n?/, ""
24+
inreplace "cmake_support/PROMOD3.cmake", /\s*\$\{Python_LIBRARIES\}\s*/, " "
25+
2026
elsif OS.linux?
2127
ENV.prepend "LDFLAGS", "-Wl,--allow-shlib-undefined,--export-dynamic -lstdc++"
2228
end
2329

24-
# Disable linking directly to CPython shared libraries
2530
inreplace "CMakeLists.txt", "find_package(Python 3.6", "find_package(Python 3"
26-
inreplace "cmake_support/PROMOD3.cmake",
27-
/^\s*set\(CMAKE_REQUIRED_FLAGS "\$\{CMAKE_REQUIRED_FLAGS\} \$\{Python_LIBRARIES\}"\)\n?/, ""
28-
inreplace "cmake_support/PROMOD3.cmake", /\s*\$\{Python_LIBRARIES\}\s*/, " "
2931

3032
mkdir "build" do
3133
cmake_args = std_cmake_args + %W[

0 commit comments

Comments
 (0)