From f0cefa588890b300b0c70741d7ac7769f21b352a Mon Sep 17 00:00:00 2001 From: Doris Wu Date: Mon, 9 Dec 2024 22:20:49 +0800 Subject: [PATCH] Prevent fgviewer being built before ready Add comment to fgviewer related lines Fix cmake commands --- CMakeLists.txt | 10 ++++++---- android/build.gradle | 11 ++++++++++- android/filament-android/CMakeLists.txt | 17 ++++++++++------- build.sh | 3 ++- 4 files changed, 28 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 404fffae101..b8462d29f1e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -528,7 +528,8 @@ endif() # By default, link in matdbg/fgviewer for Desktop + Debug only since it pulls in filamat and a web server. if (CMAKE_BUILD_TYPE STREQUAL "Debug" AND IS_HOST_PLATFORM) option(FILAMENT_ENABLE_MATDBG "Enable the material debugger" ON) - option(FILAMENT_ENABLE_FGVIEWER "Enable the frame graph viewer" ON) + # TODO: Uncomment below when fgviewer is ready + # option(FILAMENT_ENABLE_FGVIEWER "Enable the frame graph viewer" ON) else() option(FILAMENT_ENABLE_MATDBG "Enable the material debugger" OFF) option(FILAMENT_ENABLE_FGVIEWER "Enable the frame graph viewer" OFF) @@ -781,9 +782,10 @@ if (FILAMENT_BUILD_FILAMAT OR IS_HOST_PLATFORM) add_subdirectory(${LIBRARIES}/matdbg) endif() - if (FILAMENT_ENABLE_FGVIEWER OR IS_HOST_PLATFORM) - add_subdirectory(${LIBRARIES}/fgviewer) - endif() + # TODO: Uncomment below when fgviewer is ready + # if (FILAMENT_ENABLE_FGVIEWER OR IS_HOST_PLATFORM) + # add_subdirectory(${LIBRARIES}/fgviewer) + # endif() endif() if (FILAMENT_SUPPORTS_VULKAN) diff --git a/android/build.gradle b/android/build.gradle index 5bd34a29b86..293387890ee 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -11,6 +11,9 @@ // com.google.android.filament.exclude-vulkan // When set, support for Vulkan will be excluded. // +// com.google.android.filament.fgviewer +// When set, enables fgviewer +// // com.google.android.filament.matdbg // When set, enables matdbg // @@ -61,6 +64,11 @@ buildscript { .gradleProperty("com.google.android.filament.exclude-vulkan") .isPresent() + // TODO: Uncomment below when fgviewer is ready + // def fgviewer = providers + // .gradleProperty("com.google.android.filament.fgviewer") + // .isPresent() + def matdbg = providers .gradleProperty("com.google.android.filament.matdbg") .isPresent() @@ -115,7 +123,8 @@ buildscript { "-DANDROID_STL=c++_static", "-DFILAMENT_DIST_DIR=${filamentPath}".toString(), "-DFILAMENT_SUPPORTS_VULKAN=${excludeVulkan ? 'OFF' : 'ON'}".toString(), - "-DFILAMENT_ENABLE_FGVIEWER=${fgviewer ? 'ON' : 'OFF'}".toString(), + // TODO: Uncomment below when fgviewer is ready + // "-DFILAMENT_ENABLE_FGVIEWER=${fgviewer ? 'ON' : 'OFF'}".toString(), "-DFILAMENT_ENABLE_MATDBG=${matdbg ? 'ON' : 'OFF'}".toString(), "-DFILAMENT_DISABLE_MATOPT=${matnopt ? 'ON' : 'OFF'}".toString() ] diff --git a/android/filament-android/CMakeLists.txt b/android/filament-android/CMakeLists.txt index 9e36b4a8b3b..21da97e6b70 100644 --- a/android/filament-android/CMakeLists.txt +++ b/android/filament-android/CMakeLists.txt @@ -2,7 +2,8 @@ cmake_minimum_required(VERSION 3.19) project(filament-android) option(FILAMENT_SUPPORTS_VULKAN "Enables Vulkan on Android" OFF) -option(FILAMENT_ENABLE_FGVIEWER "Enables Frame Graph Viewer" OFF) +# TODO: Uncomment below when fgviewer is ready +# option(FILAMENT_ENABLE_FGVIEWER "Enables Frame Graph Viewer" OFF) option(FILAMENT_ENABLE_MATDBG "Enables Material debugger" OFF) option(FILAMENT_DISABLE_MATOPT "Disables material optimizations" OFF) @@ -52,11 +53,12 @@ add_library(smol-v STATIC IMPORTED) set_target_properties(smol-v PROPERTIES IMPORTED_LOCATION ${FILAMENT_DIR}/lib/${ANDROID_ABI}/libsmol-v.a) -if (FILAMENT_ENABLE_FGVIEWER) - add_library(fgviewer STATIC IMPORTED) - set_target_properties(fgviewer PROPERTIES IMPORTED_LOCATION - ${FILAMENT_DIR}/lib/${ANDROID_ABI}/libfgviewer.a) -endif() +# TODO: Uncomment below when fgviewer is ready +# if (FILAMENT_ENABLE_FGVIEWER) +# add_library(fgviewer STATIC IMPORTED) +# set_target_properties(fgviewer PROPERTIES IMPORTED_LOCATION +# ${FILAMENT_DIR}/lib/${ANDROID_ABI}/libfgviewer.a) +# endif() if (FILAMENT_ENABLE_MATDBG) add_library(matdbg STATIC IMPORTED) @@ -124,7 +126,8 @@ target_link_libraries(filament-jni # libgeometry is PUBLIC because gltfio uses it. PUBLIC geometry - $<$:fgviewer> + # TODO: Uncomment below when fgviewer is ready + # $<$:fgviewer> $<$:matdbg> $<$:filamat> $<$:bluevk> diff --git a/build.sh b/build.sh index 2b44b836c5a..21611d23952 100755 --- a/build.sh +++ b/build.sh @@ -824,7 +824,8 @@ while getopts ":hacCfgijmp:q:uvslwedk:bx:S:X:" opt; do ;; d) PRINT_MATDBG_HELP=true - FGVIEWER_OPTION="-DFILAMENT_ENABLE_FGVIEWER=ON" + # TODO: Uncomment below when fgviewer is ready + # FGVIEWER_OPTION="-DFILAMENT_ENABLE_FGVIEWER=ON" MATDBG_OPTION="-DFILAMENT_ENABLE_MATDBG=ON, -DFILAMENT_BUILD_FILAMAT=ON" MATDBG_GRADLE_OPTION="-Pcom.google.android.filament.matdbg" ;;