Skip to content

Commit bf7e5f9

Browse files
fix(setup): support overriding CMake args (#3577)
* fix: support conda-forge * Update setup.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent dc4717b commit bf7e5f9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

setup.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,13 @@ def remove_output(*sources):
146146
"-DBUILD_TESTING=OFF",
147147
"-DPYBIND11_NOPYTHON=ON",
148148
]
149+
if "CMAKE_ARGS" in os.environ:
150+
fcommand = [
151+
c
152+
for c in os.environ["CMAKE_ARGS"].split()
153+
if "DCMAKE_INSTALL_PREFIX" not in c
154+
]
155+
cmd += fcommand
149156
cmake_opts = dict(cwd=DIR, stdout=sys.stdout, stderr=sys.stderr)
150157
subprocess.check_call(cmd, **cmake_opts)
151158
subprocess.check_call(["cmake", "--install", tmpdir], **cmake_opts)

0 commit comments

Comments
 (0)