Skip to content

Commit

Permalink
Add build script
Browse files Browse the repository at this point in the history
  • Loading branch information
ndevenish committed Jan 10, 2025
1 parent 890d7e1 commit b84c141
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
12 changes: 10 additions & 2 deletions .github/prepare_conda_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,16 @@ def _run_parser(*args):
*args,
]
cmd = [str(x) for x in cmd]
print(" + " + shlex.join(cmd))
proc = subprocess.run(cmd, capture_output=True, check=True, text=True)
try:
proc = subprocess.run(
cmd, check=True, text=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT
)
except subprocess.CalledProcessError as p:
print("Error getting dependencies " + " ".join(args) + ":")
print(" + " + shlex.join(cmd))
print(p.stdout)
sys.exit(1)

return proc.stdout


Expand Down
16 changes: 16 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash

if [[ $CONDA_TOOLCHAIN_BUILD != $CONDA_TOOLCHAIN_HOST ]]; then
# Conda does some swizzling when cross compiling, including moving
# the site-packages folder to the build prefix. So let's just
# manually add this to the compiler search path.
CFLAGS="-isystem $BUILD_PREFIX/lib/python$PY_VER/site-packages $CXXFLAGS"
CXXFLAGS="-isystem $BUILD_PREFIX/lib/python$PY_VER/site-packages $CXXFLAGS"
fi

mkdir _build
cd _build
cmake ${CMAKE_ARGS} ../dxtbx "-DCMAKE_INSTALL_PREFIX=$PREFIX" "-DPython_EXECUTABLE=$PYTHON" -GNinja
cmake --build .
cmake --install .
$PYTHON -mpip install ../dxtbx

0 comments on commit b84c141

Please sign in to comment.