Browse Source

package/archlinux: use Ninja Multi-Config for the dev PKGBUILD.

So I have at least some semi-convenient way to switch to a debug build
in order to debug a strange crash or assertion.
next
Vladimír Vondruš 3 years ago
parent
commit
b5557a94cd
  1. 5
      doc/python/conf.py
  2. 18
      package/archlinux/PKGBUILD
  3. 5
      src/python/corrade/test/__init__.py
  4. 5
      src/python/magnum/test/__init__.py

5
doc/python/conf.py

@ -3,7 +3,10 @@ import sys
from typing import List from typing import List
# TODO make this less brittle # 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
import corrade.containers import corrade.containers

18
package/archlinux/PKGBUILD

@ -13,22 +13,28 @@ provides=('magnum-bindings-git')
_rootdir=$startdir/../../ _rootdir=$startdir/../../
_buildtype=Release
# _buildtype=Debug
build() { build() {
mkdir -p "$_rootdir/build" mkdir -p "$_rootdir/build"
cd "$_rootdir/build" cd "$_rootdir/build"
# Only one of these is built
cmake .. \ 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 \ -DCMAKE_INSTALL_PREFIX=/usr \
-DMAGNUM_WITH_PYTHON=ON \ -DMAGNUM_WITH_PYTHON=ON \
-DMAGNUM_BUILD_TESTS=ON \ -DMAGNUM_BUILD_TESTS=ON \
-G Ninja -G "Ninja Multi-Config"
ninja ninja all:$_buildtype
} }
check() { check() {
cd "$_rootdir/build" 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" cd "$_rootdir/src/python/corrade"
python -m unittest -v python -m unittest -v
@ -43,9 +49,9 @@ check() {
package() { package() {
# Helper headers # Helper headers
cd "$_rootdir/build" cd "$_rootdir/build"
DESTDIR="$pkgdir/" ninja install DESTDIR="$pkgdir/" ninja install:$_buildtype
# Native and python packages # Native and python packages
cd "$_rootdir/build/src/python" cd "$_rootdir/build/src/python/$_buildtype"
python setup.py install --root="$pkgdir" --prefix=/usr python setup.py install --root="$pkgdir" --prefix=/usr
} }

5
src/python/corrade/test/__init__.py

@ -27,4 +27,7 @@ import os
import sys import sys
# TODO: do this differently / more robustly # 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

5
src/python/magnum/test/__init__.py

@ -28,7 +28,10 @@ import sys
import unittest import unittest
# TODO: do this differently / more robustly # 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 *
from magnum import gl, platform from magnum import gl, platform

Loading…
Cancel
Save