Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions .github/workflows/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@ jobs:
- name: Build Dive host tools with VS 2022
run: |
cmake --build build --config Release
- name: Produce install artifacts
run: |
cmake --install build --prefix build/install_artifact --config Release
- name: Upload test output
uses: actions/upload-artifact@v6
with:
name: install_artifact_windows
path: build/install_artifact
- name: Run tests
run: |
ctest --output-on-failure -C Release --test-dir build
Expand Down Expand Up @@ -280,7 +288,12 @@ jobs:
cat build/.ninja_log
- name: Produce install artifacts
run: |
cmake --install build --prefix install --config Release
cmake --install build --prefix build/install_artifact --config Release
- name: Upload test output
uses: actions/upload-artifact@v6
with:
name: install_artifact_linux
path: build/install_artifact
- name: Start Xvfb
run: |
Xvfb :99 -screen 0 1024x768x24 &
Expand Down Expand Up @@ -403,7 +416,14 @@ jobs:
cat build/.ninja_log
- name: Produce install artifacts
run: |
cmake --install build --prefix install --config Release
cmake --install build --prefix build/install_artifact --config Release
- name: Upload test output
uses: actions/upload-artifact@v6
with:
name: install_artifact_macos
path: |
build/ui/dive.app
build/install_artifact
- name: Run tests
run: |
ctest --output-on-failure -C Release --test-dir build
Expand Down
12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,18 @@ option(
ON
)

set(DIVE_ANDROID_PREBUILT
"${CMAKE_SOURCE_DIR}/install"
CACHE STRING
"Prebuilt Dive Android binaries"
)

set(DIVE_PROFILING_PLUGIN_PATH
"${CMAKE_SOURCE_DIR}/install/dive_profiling_plugin"
CACHE STRING
"Prebuilt Dive Profiling Plugin"
)

option(DIVE_BUILD_WITH_SANITIZER "Build Dive with sanitizers" OFF)

# Placeholder value for DESTINATION to override cmake default.
Expand Down
62 changes: 43 additions & 19 deletions ui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -322,11 +322,54 @@ if(MSVC)
endif()

if(APPLE)
set(MACOS_RESOURCE_FILES "")

if(EXISTS "${DIVE_ANDROID_PREBUILT}")
list(
APPEND MACOS_RESOURCE_FILES
"${DIVE_ANDROID_PREBUILT}/gfxr-replay.apk"
"${DIVE_ANDROID_PREBUILT}/gfxrecon.py"
"${DIVE_ANDROID_PREBUILT}/libVkLayer_dive.so"
"${DIVE_ANDROID_PREBUILT}/libVkLayer_khronos_validation.so"
"${DIVE_ANDROID_PREBUILT}/libXrApiLayer_dive.so"
"${DIVE_ANDROID_PREBUILT}/XrApiLayer_dive.json"
"${DIVE_ANDROID_PREBUILT}/libVkLayer_rt_dive.so"
"${DIVE_ANDROID_PREBUILT}/libwrap.so"
"${DIVE_ANDROID_PREBUILT}/libVkLayer_gfxreconstruct.so"
)
endif()

set_target_properties(
${PROJECT_NAME}
PROPERTIES
MACOSX_BUNDLE TRUE
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.in"
RESOURCE "${MACOS_RESOURCE_FILES}"
)

if(EXISTS "${DIVE_PROFILING_PLUGIN_PATH}")
add_custom_command(
TARGET ${PROJECT_NAME}
POST_BUILD
COMMAND
cp -r "${DIVE_PROFILING_PLUGIN_PATH}"
"$<TARGET_BUNDLE_DIR:${PROJECT_NAME}>/Contents/Resources/dive_profiling_plugin"
)
endif()

# Install Qt Dependencies
add_custom_command(
TARGET ${PROJECT_NAME}
POST_BUILD
COMMAND macdeployqt "$<TARGET_BUNDLE_DIR:${PROJECT_NAME}>"
)
# Add dive.app/MacOS/dive_client_cli
add_custom_command(
TARGET ${PROJECT_NAME}
POST_BUILD
COMMAND
cp "$<TARGET_FILE:dive_client_cli>"
"$<TARGET_BUNDLE_DIR:${PROJECT_NAME}>/Contents/MacOS"
)
endif()

Expand All @@ -336,27 +379,8 @@ if(APPLE)
install(
CODE
"
message(STATUS \"Running macdeployqt...\")
execute_process(COMMAND \"macdeployqt\" \"${CMAKE_INSTALL_PREFIX}/dive.app\")
message(STATUS \"Creating install directory in app bundle\")
execute_process(COMMAND \"${CMAKE_COMMAND}\" -E make_directory \"${CMAKE_INSTALL_PREFIX}/dive.app/Contents/Resources/\")
message(STATUS \"Copying Android files to app bundle\")
execute_process(COMMAND \"${CMAKE_COMMAND}\" -E copy \"${CMAKE_INSTALL_PREFIX}/gfxr-replay.apk\" \"${CMAKE_INSTALL_PREFIX}/dive.app/Contents/Resources/\")
execute_process(COMMAND \"${CMAKE_COMMAND}\" -E copy \"${CMAKE_INSTALL_PREFIX}/gfxrecon.py\" \"${CMAKE_INSTALL_PREFIX}/dive.app/Contents/Resources/\")
execute_process(COMMAND \"${CMAKE_COMMAND}\" -E copy \"${CMAKE_INSTALL_PREFIX}/libVkLayer_dive.so\" \"${CMAKE_INSTALL_PREFIX}/dive.app/Contents/Resources/\")
execute_process(COMMAND \"${CMAKE_COMMAND}\" -E copy \"${CMAKE_INSTALL_PREFIX}/libVkLayer_khronos_validation.so\" \"${CMAKE_INSTALL_PREFIX}/dive.app/Contents/Resources/\")
execute_process(COMMAND \"${CMAKE_COMMAND}\" -E copy \"${CMAKE_INSTALL_PREFIX}/libXrApiLayer_dive.so\" \"${CMAKE_INSTALL_PREFIX}/dive.app/Contents/Resources/\")
execute_process(COMMAND \"${CMAKE_COMMAND}\" -E copy \"${CMAKE_INSTALL_PREFIX}/XrApiLayer_dive.json\" \"${CMAKE_INSTALL_PREFIX}/dive.app/Contents/Resources/\")
execute_process(COMMAND \"${CMAKE_COMMAND}\" -E copy \"${CMAKE_INSTALL_PREFIX}/libVkLayer_rt_dive.so\" \"${CMAKE_INSTALL_PREFIX}/dive.app/Contents/Resources/\")
execute_process(COMMAND \"${CMAKE_COMMAND}\" -E copy \"${CMAKE_INSTALL_PREFIX}/libwrap.so\" \"${CMAKE_INSTALL_PREFIX}/dive.app/Contents/Resources/\")
execute_process(COMMAND \"${CMAKE_COMMAND}\" -E copy \"${CMAKE_INSTALL_PREFIX}/libVkLayer_gfxreconstruct.so\" \"${CMAKE_INSTALL_PREFIX}/dive.app/Contents/Resources/\")
message(STATUS \"Copying dive_client_cli to app bundle\")
execute_process(COMMAND \"${CMAKE_COMMAND}\" -E copy \"${CMAKE_INSTALL_PREFIX}/dive_client_cli\" \"${CMAKE_INSTALL_PREFIX}/dive.app/Contents/MacOS/\")

if(IS_DIRECTORY \"${CMAKE_INSTALL_PREFIX}/dive_profiling_plugin\")
message(STATUS \"Copying dive_profiling_plugin to app bundle\")
execute_process(COMMAND \"${CMAKE_COMMAND}\" -E copy_directory \"${CMAKE_INSTALL_PREFIX}/dive_profiling_plugin/\" \"${CMAKE_INSTALL_PREFIX}/dive.app/Contents/Resources/dive_profiling_plugin\")
endif()
if(EXISTS \"${CMAKE_INSTALL_PREFIX}/dive_compositor_capture.sh\")
message(STATUS \"Copying dive_compositor_capture.sh to app bundle\")
execute_process(COMMAND \"${CMAKE_COMMAND}\" -E copy \"${CMAKE_INSTALL_PREFIX}/dive_compositor_capture.sh\" \"${CMAKE_INSTALL_PREFIX}/dive.app/Contents/MacOS/\")
Expand Down
Loading