Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions autotest/test_build.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import os
import sys
import time
from platform import system

import pytest
from flaky import flaky
from modflow_devtools.misc import get_ostag, set_dir
from modflow_devtools.misc import get_ostag, set_dir, set_env

import pymake

Expand Down Expand Up @@ -65,9 +66,15 @@ def build_with_makefile(target, path, fc):
@pytest.mark.parametrize("target", targets)
def test_build(function_tmpdir, target: str) -> None:
with set_dir(function_tmpdir):
pm = pymake.Pymake(verbose=True)
pm.target = target
pm.inplace = True
if system() == "Darwin":
pm.syslibs = "-Wl,-ld_classic"
assert (
pymake.build_apps(
target,
pm,
verbose=True,
clean=False,
)
Expand All @@ -79,7 +86,10 @@ def test_build(function_tmpdir, target: str) -> None:
@flaky(max_runs=RERUNS)
@pytest.mark.parametrize("target", targets_meson)
def test_meson_build(function_tmpdir, target: str) -> None:
with set_dir(function_tmpdir):
kwargs = {}
if system() == "Darwin":
kwargs["LDFLAGS"] = "-Wl,-ld_classic"
with set_dir(function_tmpdir), set_env(**kwargs):
assert (
pymake.build_apps(
target,
Expand All @@ -103,6 +113,8 @@ def test_makefile_build(function_tmpdir, target: str) -> None:
pm.inplace = True
pm.dryrun = True
pm.makeclean = False
if system() == "Darwin":
pm.syslibs = "-Wl,-ld_classic"

with set_dir(function_tmpdir):
pm.download_target(target)
Expand Down
8 changes: 5 additions & 3 deletions autotest/test_gridgen.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os
import pathlib as pl
import subprocess
from os import environ
from platform import system

import pytest
Expand Down Expand Up @@ -30,8 +30,10 @@ def pm(module_tmpdir, target) -> pymake.Pymake:
pm = pymake.Pymake(verbose=True)
pm.target = str(target)
pm.appdir = str(module_tmpdir)
pm.cc = os.environ.get("CXX", "g++")
pm.fc = os.environ.get("FC", "gfortran")
pm.cc = environ.get("CXX", "g++")
pm.fc = environ.get("FC", "gfortran")
if system() == "Darwin":
pm.syslibs = "-Wl,-ld_classic"
pm.inplace = True
pm.makeclean = True
yield pm
Expand Down