@@ -54,15 +54,16 @@ function print_help {
54
54
echo " Build arm64/x86_64 universal libraries."
55
55
echo " For iOS, this builds universal binaries for devices and the simulator (implies -s)."
56
56
echo " For macOS, this builds universal binaries for both Apple silicon and Intel-based Macs."
57
- echo " -w"
58
- echo " Build Web documents (compiles .md.html files to .html)."
59
57
echo " -k sample1,sample2,..."
60
58
echo " When building for Android, also build select sample APKs."
61
59
echo " sampleN is an Android sample, e.g., sample-gltf-viewer."
62
60
echo " This automatically performs a partial desktop build and install."
63
61
echo " -b"
64
62
echo " Enable Address and Undefined Behavior Sanitizers (asan/ubsan) for debugging."
65
63
echo " This is only for the desktop build."
64
+ echo " -V"
65
+ echo " Enable LLVM code coverage for debug builds."
66
+ echo " This is only for the desktop build."
66
67
echo " -x value"
67
68
echo " Define a preprocessor flag FILAMENT_BACKEND_DEBUG_FLAG with [value]. This is useful for"
68
69
echo " enabling debug paths in the backend from the build script. For example, make a"
@@ -182,8 +183,6 @@ BUILD_JS_DOCS=false
182
183
183
184
ISSUE_CMAKE_ALWAYS=false
184
185
185
- ISSUE_WEB_DOCS=false
186
-
187
186
ANDROID_SAMPLES=()
188
187
BUILD_ANDROID_SAMPLES=false
189
188
@@ -208,6 +207,7 @@ MATOPT_OPTION=""
208
207
MATOPT_GRADLE_OPTION=" "
209
208
210
209
ASAN_UBSAN_OPTION=" "
210
+ COVERAGE_OPTION=" "
211
211
212
212
BACKEND_DEBUG_FLAG_OPTION=" "
213
213
@@ -275,6 +275,7 @@ function build_desktop_target {
275
275
${MATDBG_OPTION} \
276
276
${MATOPT_OPTION} \
277
277
${ASAN_UBSAN_OPTION} \
278
+ ${COVERAGE_OPTION} \
278
279
${BACKEND_DEBUG_FLAG_OPTION} \
279
280
${STEREOSCOPIC_OPTION} \
280
281
${OSMESA_OPTION} \
@@ -726,21 +727,6 @@ function build_ios {
726
727
fi
727
728
}
728
729
729
- function build_web_docs {
730
- echo " Building Web documents..."
731
-
732
- mkdir -p out/web-docs
733
- cp -f docs/web-docs-package.json out/web-docs/package.json
734
- pushd out/web-docs > /dev/null
735
-
736
- npm install > /dev/null
737
-
738
- # Generate documents
739
- npx markdeep-rasterizer ../../docs/Filament.md.html ../../docs/Materials.md.html ../../docs/
740
-
741
- popd > /dev/null
742
- }
743
-
744
730
function validate_build_command {
745
731
set +e
746
732
# Make sure CMake is installed
@@ -772,16 +758,6 @@ function validate_build_command {
772
758
echo " Error: EMSDK is not set, exiting"
773
759
exit 1
774
760
fi
775
- # Web documents require node and npm for processing
776
- if [[ " ${ISSUE_WEB_DOCS} " == " true" ]]; then
777
- local node_binary=$( command -v node)
778
- local npm_binary=$( command -v npm)
779
- local npx_binary=$( command -v npx)
780
- if [[ ! " ${node_binary} " ]] || [[ ! " ${npm_binary} " ]] || [[ ! " ${npx_binary} " ]]; then
781
- echo " Error: Web documents require node, npm and npx to be installed"
782
- exit 1
783
- fi
784
- fi
785
761
786
762
# Make sure FILAMENT_BACKEND_DEBUG_FLAG is only meant for debug builds
787
763
if [[ " ${ISSUE_DEBUG_BUILD} " != " true" ]] && [[ ! -z " ${BACKEND_DEBUG_FLAG_OPTION} " ]]; then
@@ -821,8 +797,7 @@ function run_tests {
821
797
function check_debug_release_build {
822
798
if [[ " ${ISSUE_DEBUG_BUILD} " == " true" || \
823
799
" ${ISSUE_RELEASE_BUILD} " == " true" || \
824
- " ${ISSUE_CLEAN} " == " true" || \
825
- " ${ISSUE_WEB_DOCS} " == " true" ]]; then
800
+ " ${ISSUE_CLEAN} " == " true" ]]; then
826
801
" $@ " ;
827
802
else
828
803
echo " You must declare a debug or release target for $@ builds."
@@ -835,7 +810,7 @@ function check_debug_release_build {
835
810
836
811
pushd " $( dirname " $0 " ) " > /dev/null
837
812
838
- while getopts " :hacCfgimp:q:uvWslwedtk:bx :S:X:" opt; do
813
+ while getopts " :hacCfgimp:q:uvWslwedtk:bVx :S:X:" opt; do
839
814
case ${opt} in
840
815
h)
841
816
print_help
@@ -973,16 +948,16 @@ while getopts ":hacCfgimp:q:uvWslwedtk:bx:S:X:" opt; do
973
948
BUILD_UNIVERSAL_LIBRARIES=true
974
949
echo " Building universal libraries."
975
950
;;
976
- w)
977
- ISSUE_WEB_DOCS=true
978
- ;;
979
951
k)
980
952
BUILD_ANDROID_SAMPLES=true
981
953
ANDROID_SAMPLES=$( echo " ${OPTARG} " | tr ' ,' ' \n' )
982
954
;;
983
955
b) ASAN_UBSAN_OPTION=" -DFILAMENT_ENABLE_ASAN_UBSAN=ON"
984
956
echo " Enabled ASAN/UBSAN"
985
957
;;
958
+ V) COVERAGE_OPTION=" -DFILAMENT_ENABLE_COVERAGE=ON"
959
+ echo " Enabled coverage"
960
+ ;;
986
961
x) BACKEND_DEBUG_FLAG_OPTION=" -DFILAMENT_BACKEND_DEBUG_FLAG=${OPTARG} "
987
962
;;
988
963
S) case $( echo " ${OPTARG} " | tr ' [:upper:]' ' [:lower:]' ) in
@@ -1059,10 +1034,6 @@ if [[ "${ISSUE_WEBGL_BUILD}" == "true" ]]; then
1059
1034
check_debug_release_build build_webgl
1060
1035
fi
1061
1036
1062
- if [[ " ${ISSUE_WEB_DOCS} " == " true" ]]; then
1063
- build_web_docs
1064
- fi
1065
-
1066
1037
if [[ " ${RUN_TESTS} " == " true" ]]; then
1067
1038
run_tests
1068
1039
fi
0 commit comments