diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000000000000000000000000000000000000..ba49e3c234913ddbb57957b024d6977096125696 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,5 @@ +root = true + +[*] +indent_style = tab +indent_size = 4 diff --git a/.gitignore b/.gitignore index 6758a636f7a5e626b57893bb16b624fb40763c8f..c022ba09c0332fbbf89659d4d47ee03c22a445b3 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ obj-*/ +build/ +*.sublime-workspace + diff --git a/CMakeLists.txt b/CMakeLists.txt index eb55d577539c9cc8ca5f6c1f4343371ee52a2cda..b11c129c43181908a9df13f0703a3627b7103c99 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -84,8 +84,8 @@ set_property(TARGET shadertoy PROPERTY CXX_STANDARD 14) # Include directories for install set_property(TARGET shadertoy APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES - $<BUILD_INTERFACE:${INCLUDE_DIR}/shadertoy> - $<INSTALL_INTERFACE:include/shadertoy> + $<BUILD_INTERFACE:${INCLUDE_DIR}> + $<INSTALL_INTERFACE:include> $<INSTALL_INTERFACE:${Boost_INCLUDE_DIR}>) # Precompiled header optimization diff --git a/build.sh b/build.sh index d40213208358418cb7e0745fd3da624fca77b702..2b9073b4c0202b853f56dd3197b280a8e5f285ea 100755 --- a/build.sh +++ b/build.sh @@ -32,4 +32,6 @@ done # Else, default build ./configure.sh "$@" cd build -make -j9 +if make -j9; then + make DESTDIR=$(pwd)/install install +fi diff --git a/debian/files b/debian/files deleted file mode 100644 index 24627f331a8f1771469efbdb8f10e21e4f3a03e0..0000000000000000000000000000000000000000 --- a/debian/files +++ /dev/null @@ -1,2 +0,0 @@ -libshadertoy-dev_0.0.1_amd64.deb libdevel optional -libshadertoy0_0.0.1_amd64.deb libs optional diff --git a/debian/tests/00-build b/debian/tests/00-build old mode 100644 new mode 100755 index 7385eaff47752acc3a83397418af2b272a7056cd..cc59631a11f472a0ac0f5b69a6a7c815e91d4dce --- a/debian/tests/00-build +++ b/debian/tests/00-build @@ -1,7 +1,15 @@ #!/bin/bash +if [ -z "$LIBSHADERTOY_DIR" ]; then + LIBSHADERTOY_DIR=/usr/share/shadertoy +fi + +if [ -z "$CMAKE_EXTRA_OPTS" ]; then + CMAKE_EXTRA_OPTS="" +fi + # Copy example from datadir -cp -r /usr/share/shadertoy/examples/00-build "$AUTOPKGTEST_TMP" +cp -r "$LIBSHADERTOY_DIR/examples/00-build" "$AUTOPKGTEST_TMP" cd "$AUTOPKGTEST_TMP/00-build" # Configure @@ -9,7 +17,7 @@ set -eo pipefail mkdir build cd build -cmake .. +cmake $CMAKE_EXTRA_OPTS .. # Build make -j VERBOSE=1 diff --git a/include/shadertoy/UniformState_decl.hpp b/include/shadertoy/UniformState_decl.hpp index 3944f14db415322042b8c9bd8539e04b09f885e4..e3dae445f013c168e54f0ab3e17f04aa940e50e7 100644 --- a/include/shadertoy/UniformState_decl.hpp +++ b/include/shadertoy/UniformState_decl.hpp @@ -3,11 +3,11 @@ /** * @brief Helper macro to declare a uniform instance */ -#define DECLARE_UNIFORM(type, name) extern const char name ## Name []; typedef shadertoy::ShaderInput<name ## Name, type> name +#define DECLARE_UNIFORM(type, name) extern const char name ## Name []; typedef ShaderInput<name ## Name, type> name /** * @brief Helper macro to declare a uniform instance as an array */ -#define DECLARE_UNIFORM_N(type, name, n) extern const char name ## Name []; typedef shadertoy::ShaderInput<name ## Name, type, n> name +#define DECLARE_UNIFORM_N(type, name, n) extern const char name ## Name []; typedef ShaderInput<name ## Name, type, n> name #endif #else /* IMPLEMENT_UNIFORM_STATE */ #undef DECLARE_UNIFORM diff --git a/include/shadertoy/pre.hpp b/include/shadertoy/pre.hpp index ff6d4b676e0dfc23a30269788373f4fe85224ae5..a53e407cb7dac9b4ab706e3a5daab1a881b7a9b3 100644 --- a/include/shadertoy/pre.hpp +++ b/include/shadertoy/pre.hpp @@ -1,8 +1,6 @@ #ifndef _SHADERTOY_PRE_HPP_ #define _SHADERTOY_PRE_HPP_ -#include "shadertoy/config.hpp" - #include <oglplus/all.hpp> #include <boost/filesystem.hpp> diff --git a/libshadertoy.sublime-project b/libshadertoy.sublime-project new file mode 100644 index 0000000000000000000000000000000000000000..61a654f6194fba9d4896650463e1e5ff89993dd7 --- /dev/null +++ b/libshadertoy.sublime-project @@ -0,0 +1,14 @@ +{ + "folders": [ + { + "folder_exclude_patterns": [ + "obj-x86_64-linux-gnu", + "debian/tmp", + "debian/.debhelper", + "debian/libshadertoy0", + "debian/libshadertoy-dev" + ], + "path": "." + } + ] +} \ No newline at end of file diff --git a/test.sh b/test.sh new file mode 100755 index 0000000000000000000000000000000000000000..616b85cc3ae1efa14016e9254f2707127209dd52 --- /dev/null +++ b/test.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +for TEST_FILE in debian/tests/*; do + if [ -x "$TEST_FILE" ]; then + TEST_NAME=$(basename "$TEST_FILE") + + echo "[==== RUNNING TEST: $TEST_NAME ====]" >&2 + + # Create temporary directory + TEST_DIR=`mktemp -d` + export AUTOPKGTEST_TMP="$TEST_DIR" + + # Setup special vars + export LIBSHADERTOY_DIR=$(pwd)/build/install/usr/local/share/shadertoy + export CMAKE_EXTRA_OPTS="-DCMAKE_PREFIX_PATH=$(pwd)/build/install/usr/local" + + # Execute test + "$TEST_FILE" + TEST_RESULT=$? + + if [ "$TEST_RESULT" -eq 0 ]; then + echo "[==== TEST: $TEST_NAME: PASSED ====]" >&2 + else + echo "[==== TEST: $TEST_NAME: FAILED ($TEST_RESULT) ====]" >&2 + fi + + # Cleanup + rm -rf "$TEST_DIR" + fi +done