Fixed standalone compilation warnings

Fixed -Wno-pragma-once-outside-header requirement (removing 'pragma once' in combiner script). Minor docs.
This commit is contained in:
Carl Woffenden
2019-09-25 20:42:33 +02:00
parent 4a401d9ec9
commit 8bf626bb53
3 changed files with 23 additions and 15 deletions

View File

@@ -3,20 +3,19 @@
* \code
* ./combine.sh -r ../../transcoder -o basisutranslib.cpp basisutranslib-in.cpp
* \endcode
*
* \todo remove the need for -Wno-pragma-once-outside-header when compiling standalone
*/
/*
* Build options for known platforms.
* Transcoder build options for known platforms (iOS has ETC, ASTC and PVRTC;
* Emscripten same as iOS plus DXT; other platforms build all).
*
* Note: BASISD_SUPPORT_DXT5A needs enabling for BC3
* Note: BC3 needs BASISD_SUPPORT_DXT5A enabling
*/
#ifdef __APPLE__
#include <TargetConditionals.h>
#endif
#if TARGET_OS_IPHONE
#define BASISD_SUPPORT_DXT1 0
#define BASISD_SUPPORT_DXT1 0
#define BASISD_SUPPORT_DXT5A 0
#endif
#if TARGET_OS_IPHONE || defined(__EMSCRIPTEN__)

View File

@@ -7,7 +7,7 @@
#
# TODO: ROOTS and FOUND as arrays (since they fail on paths with spaces)
#
# Released under a CC0 license.
# Script released under a CC0 license.
# Common file roots
ROOTS="./"
@@ -29,10 +29,10 @@ usage() {
# Tests that the grep implementation works as expected (older OSX grep fails)
test_grep() {
if ! echo '#include "foo"' | grep -Eq '^\s*#\s*include\s*".+"'; then
echo "Aborting: the grep implementation fails to parse include lines"
exit 1
fi
if ! echo '#include "foo"' | grep -Eq '^\s*#\s*include\s*".+"'; then
echo "Aborting: the grep implementation fails to parse include lines"
exit 1
fi
}
# Tests if list $1 has item $2 (returning zero on a match)
@@ -83,8 +83,10 @@ add_file() {
write_line "/**** skipping file: $inc ****/"
fi
else
# Otherwise write the source line
write_line "$line"
# Skip any 'pragma once' directives, otherwise write the source line
if echo "$line" | grep -Eqv '^\s*#\s*pragma\s*once\s*'; then
write_line "$line"
fi
fi
done < "$file"
else

View File

@@ -9,10 +9,17 @@
* export EM_FLAGS="-s ENVIRONMENT=web -s WASM=1 --shell-file shell.html --closure 1"
* emcc $CC_FLAGS $EM_FLAGS -o out.html emscripten.cpp
* \endcode
* Alternatively include the transcoder header and build \c basisutranslib
* separately (the resulting binary is exactly the same size).
* Alternatively include \c basisu_transcoder.h and build \c basisutranslib
* separately (the resulting binary is exactly the same size):
* \code
* emcc $CC_FLAGS $EM_FLAGS -o out.html ../basisutranslib.cpp emscripten.cpp
* \encode
* To determine the WebAssembly size without the transcoder comment the \c
* basisutranslib.cpp include (which stubs the texture creation).
* \n
* Example code released under a CC0 license.
*
* \todo add mipmap support to the example
*/
#include <cmath>
@@ -25,7 +32,7 @@
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
#include "../basisutranslib.cpp" //<-- can be built without to determine the size
#include "../basisutranslib.cpp"
//********************************* Test Data ********************************/