diff --git a/doc/python/conf.py b/doc/python/conf.py index 9677d56..d89f3ad 100644 --- a/doc/python/conf.py +++ b/doc/python/conf.py @@ -3,7 +3,10 @@ import sys from typing import List # TODO make this less brittle -sys.path = [os.path.join(os.path.dirname(__file__), '../../build/src/python/')] + sys.path +sys.path = [ + os.path.join(os.path.dirname(__file__), '../../build/src/python/'), + os.path.join(os.path.dirname(__file__), '../../build/src/python/Release') +] + sys.path import corrade import corrade.containers diff --git a/package/archlinux/PKGBUILD b/package/archlinux/PKGBUILD index 05ecc5d..ff54e2b 100644 --- a/package/archlinux/PKGBUILD +++ b/package/archlinux/PKGBUILD @@ -13,22 +13,28 @@ provides=('magnum-bindings-git') _rootdir=$startdir/../../ +_buildtype=Release +# _buildtype=Debug + build() { mkdir -p "$_rootdir/build" cd "$_rootdir/build" + # Only one of these is built cmake .. \ - -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_CONFIGURATION_TYPES="Release;Debug;RelWithDebInfo" \ + -DCMAKE_CROSS_CONFIGS=all \ + -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="-O2 -g -DNDEBUG -fno-omit-frame-pointer" \ -DCMAKE_INSTALL_PREFIX=/usr \ -DMAGNUM_WITH_PYTHON=ON \ -DMAGNUM_BUILD_TESTS=ON \ - -G Ninja - ninja + -G "Ninja Multi-Config" + ninja all:$_buildtype } check() { cd "$_rootdir/build" - CORRADE_TEST_COLOR=ON ctest --output-on-failure + CORRADE_TEST_COLOR=ON ctest --output-on-failure -C $_buildtype cd "$_rootdir/src/python/corrade" python -m unittest -v @@ -43,9 +49,9 @@ check() { package() { # Helper headers cd "$_rootdir/build" - DESTDIR="$pkgdir/" ninja install + DESTDIR="$pkgdir/" ninja install:$_buildtype # Native and python packages - cd "$_rootdir/build/src/python" + cd "$_rootdir/build/src/python/$_buildtype" python setup.py install --root="$pkgdir" --prefix=/usr } diff --git a/src/python/corrade/test/__init__.py b/src/python/corrade/test/__init__.py index ca1c40c..e30e425 100644 --- a/src/python/corrade/test/__init__.py +++ b/src/python/corrade/test/__init__.py @@ -27,4 +27,7 @@ import os import sys # TODO: do this differently / more robustly -sys.path = [os.path.join(os.path.dirname(__file__), os.environ.get('CMAKE_BINARY_DIR', '../../../../build'), 'src/python')] + sys.path +sys.path = [ + os.path.join(os.path.dirname(__file__), os.environ.get('CMAKE_BINARY_DIR', '../../../../build'), 'src/python'), + os.path.join(os.path.dirname(__file__), os.environ.get('CMAKE_BINARY_DIR', '../../../../build'), 'src/python/Release') +] + sys.path diff --git a/src/python/magnum/test/__init__.py b/src/python/magnum/test/__init__.py index 3931c3d..0abfd84 100644 --- a/src/python/magnum/test/__init__.py +++ b/src/python/magnum/test/__init__.py @@ -28,7 +28,10 @@ import sys import unittest # TODO: do this differently / more robustly -sys.path = [os.path.join(os.path.dirname(__file__), os.environ.get('CMAKE_BINARY_DIR', '../../../../build'), 'src/python')] + sys.path +sys.path = [ + os.path.join(os.path.dirname(__file__), os.environ.get('CMAKE_BINARY_DIR', '../../../../build'), 'src/python'), + os.path.join(os.path.dirname(__file__), os.environ.get('CMAKE_BINARY_DIR', '../../../../build'), 'src/python/Release'), +] + sys.path from magnum import * from magnum import gl, platform