Skip to content

Commit

Permalink
Prevent fgviewer being built before ready
Browse files Browse the repository at this point in the history
Add comment to fgviewer related lines

Fix cmake commands
  • Loading branch information
show50726 committed Dec 9, 2024
1 parent a195d26 commit f0cefa5
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 13 deletions.
10 changes: 6 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
11 changes: 10 additions & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
//
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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()
]
Expand Down
17 changes: 10 additions & 7 deletions android/filament-android/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -124,7 +126,8 @@ target_link_libraries(filament-jni
# libgeometry is PUBLIC because gltfio uses it.
PUBLIC geometry

$<$<STREQUAL:${FILAMENT_ENABLE_FGVIEWER},ON>:fgviewer>
# TODO: Uncomment below when fgviewer is ready
# $<$<STREQUAL:${FILAMENT_ENABLE_FGVIEWER},ON>:fgviewer>
$<$<STREQUAL:${FILAMENT_ENABLE_MATDBG},ON>:matdbg>
$<$<STREQUAL:${FILAMENT_ENABLE_MATDBG},ON>:filamat>
$<$<STREQUAL:${FILAMENT_SUPPORTS_VULKAN},ON>:bluevk>
Expand Down
3 changes: 2 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
;;
Expand Down

0 comments on commit f0cefa5

Please sign in to comment.