Skip to content

Commit

Permalink
[wasm] Exclude performance and install spirv-headers (PixarAnimationS…
Browse files Browse the repository at this point in the history
  • Loading branch information
kohakukun authored and GitHub Enterprise committed Nov 7, 2024
1 parent 72d8725 commit 618b8d8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
10 changes: 8 additions & 2 deletions build_scripts/build_usd.py
Original file line number Diff line number Diff line change
Expand Up @@ -1751,11 +1751,15 @@ def InstallTint(context, force, buildArgs):

# This will allow us to install the already built spirv-tools library

PatchFile("third_party/vulkan-deps/spirv-headers/src/CMakeLists.txt", [
('if (PROJECT_IS_TOP_LEVEL)\n','if (TRUE)\n')
])

PatchFile("third_party/CMakeLists.txt", [
(' set(SKIP_SPIRV_TOOLS_INSTALL ON CACHE BOOL "" FORCE)\n',
' set(SKIP_SPIRV_TOOLS_INSTALL OFF CACHE BOOL "" FORCE)\n'),
(' add_subdirectory(${TINT_SPIRV_TOOLS_DIR} "${CMAKE_CURRENT_BINARY_DIR}/spirv-tools" EXCLUDE_FROM_ALL)\n',
' add_subdirectory(${TINT_SPIRV_TOOLS_DIR} "${CMAKE_CURRENT_BINARY_DIR}/spirv-tools")\n'),
' add_subdirectory(${TINT_SPIRV_TOOLS_DIR} "${CMAKE_CURRENT_BINARY_DIR}/spirv-tools")\n')
])

PatchFile("src/tint/utils/system/terminal_posix.cc", [
Expand All @@ -1770,7 +1774,8 @@ def InstallTint(context, force, buildArgs):
'-DCMAKE_CXX_FLAGS="-Wno-unsafe-buffer-usage -Wno-disabled-macro-expansion -Wno-#warnings -Wno-error -Wno-switch-default '
+ EMSCRIPTEN_CMAKE_CXX_FLAGS + ' -s SIDE_MODULE=1"',
'-DCMAKE_EXE_LINKER_FLAGS="' + EMSCRIPTEN_CMAKE_EXE_LINKER_FLAGS + ' -s MAIN_MODULE=1"',
'-DBUILD_SHARED_LIBS=OFF'
'-DBUILD_SHARED_LIBS=OFF',
'-DCMAKE_INSTALL_DATADIR=' + os.path.join(context.instDir, 'lib')
]
cmakeOptions += buildArgs
cmakeOptions += TINT_CMAKE_OPTIONS
Expand Down Expand Up @@ -2160,6 +2165,7 @@ def InstallUSD(context, force, buildArgs):

extraArgs.append('-DPXR_ENABLE_GL_SUPPORT=ON')
extraArgs.append('-DBUILD_SHARED_LIBS=OFF')
extraArgs.append('-DPXR_BUILD_PERFORMANCE=OFF')

if context.targetWasmNode:
extraArgs.append('-DPXR_WASM_NODE=ON')
Expand Down
1 change: 1 addition & 0 deletions cmake/defaults/Options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ option(PXR_ENABLE_NAMESPACES "Enable C++ namespaces." ON)
option(PXR_PREFER_SAFETY_OVER_SPEED
"Enable certain checks designed to avoid crashes or out-of-bounds memory reads with malformed input files. These checks may negatively impact performance."
ON)
option(PXR_BUILD_PERFORMANCE "Build Performance Component." ON)

if(APPLE)
# Cross Compilation detection as defined in CMake docs
Expand Down
4 changes: 3 additions & 1 deletion extras/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
add_subdirectory(performance)
if (${PXR_BUILD_PERFORMANCE})
add_subdirectory(performance)
endif()
add_subdirectory(usd)
if (${PXR_BUILD_IMAGING})
add_subdirectory(imaging)
Expand Down
1 change: 0 additions & 1 deletion pxr/usdImaging/bin/usdviewweb/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ if (EMSCRIPTEN)
${CMAKE_CURRENT_BINARY_DIR}/${PXR_PACKAGE}.js
${CMAKE_CURRENT_BINARY_DIR}/${PXR_PACKAGE}.wasm
${CMAKE_CURRENT_BINARY_DIR}/${PXR_PACKAGE}.data
${CMAKE_CURRENT_BINARY_DIR}/${PXR_PACKAGE}.worker.js
${CMAKE_CURRENT_SOURCE_DIR}/scripts/wasm-server.py
${CMAKE_CURRENT_SOURCE_DIR}/usdviewweb.html
)
Expand Down

0 comments on commit 618b8d8

Please sign in to comment.