Skip to content

Commit

Permalink
Merge branch 'main' into disable-georeferencing-option
Browse files Browse the repository at this point in the history
  • Loading branch information
lilleyse authored Oct 2, 2023
2 parents 2e03b1b + 5433f44 commit 7f5464a
Show file tree
Hide file tree
Showing 25 changed files with 467 additions and 40 deletions.
16 changes: 8 additions & 8 deletions .github/actions/action.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
name: 'CentOS 7 Build'
description: 'Build Cesium for Omniverse in Docker container running a CentOS 7 image'
name: "CentOS 7 Build"
description: "Build Cesium for Omniverse in Docker container running a CentOS 7 image"
inputs:
build-type:
description: 'Release or debug build'
description: "Release or debug build"
required: true
runs:
using: 'docker'
image: '../../docker/CI.Dockerfile'
using: "docker"
image: "../../docker/CI.Dockerfile"
# Tell Conan to look for or create its build folder (.conan) in the repository's root directory
env:
CONAN_USER_HOME: $GITHUB_WORKSPACE
args:
# Tell bash to run a command
- '-c'
- "-c"
# Parallel 2 because github action limited to two cores
# Linters are turned off because there is no pre-compiled C++20-capable LLVM toolset for CentOS 7. It won't affect the build, it just means there won't be code formatting or linting. It will build fine with GCC.
# Make sure to configure without sanitizers and any other development options
- 'cmake -B build -D CMAKE_BUILD_TYPE=${{ inputs.build-type }} -D CESIUM_OMNI_ENABLE_LINTERS=OFF -D CESIUM_OMNI_ENABLE_SANITIZERS=OFF &&
- "cmake -B build -D CMAKE_BUILD_TYPE=${{ inputs.build-type }} -D CESIUM_OMNI_ENABLE_LINTERS=OFF -D CESIUM_OMNI_ENABLE_SANITIZERS=OFF &&
cmake --build build --parallel 2 &&
ctest --test-dir build --output-on-failure &&
cmake --build build --target install &&
cmake --build build --target package'
cmake --build build --target package"
50 changes: 25 additions & 25 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,37 +15,37 @@ jobs:
matrix:
config:
- {
name: 'Windows - MSVC',
artifact: 'windows-msvc.tar.xz',
name: "Windows - MSVC",
artifact: "windows-msvc.tar.xz",
os: windows-latest-l,
cc: 'cl',
cxx: 'cl',
build-type: 'Release',
build-code: 'Windows',
generator: 'Ninja Multi-Config',
coverage: 'false',
cc: "cl",
cxx: "cl",
build-type: "Release",
build-code: "Windows",
generator: "Ninja Multi-Config",
coverage: "false",
}
- {
name: 'Ubuntu - GCC',
artifact: 'linux-gcc.tar.xz',
name: "Ubuntu - GCC",
artifact: "linux-gcc.tar.xz",
os: ubuntu-latest-m,
cc: 'gcc-11',
cxx: 'g++-11',
build-type: 'Release',
build-code: 'Ubuntu',
generator: 'Unix Makefiles',
coverage: 'false',
cc: "gcc-11",
cxx: "g++-11",
build-type: "Release",
build-code: "Ubuntu",
generator: "Unix Makefiles",
coverage: "false",
}
- {
name: 'CentOS 7 - GCC',
artifact: 'linux-gcc.tar.xz',
name: "CentOS 7 - GCC",
artifact: "linux-gcc.tar.xz",
os: ubuntu-latest-m,
cc: 'gcc-11',
cxx: 'g++-11',
build-type: 'Release',
build-code: 'CentOS7',
generator: 'Unix Makefiles',
coverage: 'false',
cc: "gcc-11",
cxx: "g++-11",
build-type: "Release",
build-code: "CentOS7",
generator: "Unix Makefiles",
coverage: "false",
}

steps:
Expand Down Expand Up @@ -204,4 +204,4 @@ jobs:
- name: Upload to S3
if: ${{ matrix.config.name == 'CentOS 7 - GCC' || runner.os == 'Windows' }}
run: |
aws s3 cp build/${{ env.zip_name }} s3://cesium-travis-builds/cesium-omniverse/${{ env.branch }}/${{ env.us_date }}/${{ env.sha_short }}/${{ matrix.config.build-code }}/
aws s3 cp build/${{ env.zip_name }} s3://cesium-builds/cesium-omniverse/${{ env.branch }}/${{ env.us_date }}/${{ env.sha_short }}/${{ matrix.config.build-code }}/
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,13 @@ exts/cesium.omniverse/cesium/omniverse/bindings/CesiumOmniversePythonBindings.cp
exts/cesium.usd.plugins/cesium/usd/plugins/CesiumUsdSchemas/_CesiumUsdSchemas.so
exts/cesium.usd.plugins/cesium/usd/plugins/CesiumUsdSchemas/_CesiumUsdSchemas.pyd
exts/cesium.usd.plugins/cesium/usd/plugins/CesiumUsdSchemas/_CesiumUsdSchemas.lib
exts/cesium.omniverse.cpp.tests/cesium/omniverse/cpp/tests/bindings/CesiumOmniverseCppTestsPythonBindings.cpython-310-x86_64-linux-gnu.so
exts/cesium.omniverse.cpp.tests/cesium/omniverse/cpp/tests/bindings/CesiumOmniverseCppTestsPythonBindings.cp310-win_amd64.pyd

# Installed libraries
exts/cesium.omniverse/bin/
exts/cesium.usd.plugins/bin/
exts/cesium.omniverse.cpp.tests/bin/

# Installed plugins
exts/cesium.usd.plugins/plugins/
Expand Down
2 changes: 1 addition & 1 deletion .vscode/cesium-omniverse-linux.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"editor.tabSize": 2,
"editor.insertSpaces": true
},
"yaml.format.singleQuote": true,
"yaml.format.singleQuote": false,
"files.associations": {
"*.kit": "toml"
},
Expand Down
2 changes: 1 addition & 1 deletion .vscode/cesium-omniverse-windows.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"editor.tabSize": 2,
"editor.insertSpaces": true
},
"yaml.format.singleQuote": true,
"yaml.format.singleQuote": false,
"files.associations": {
"*.kit": "toml"
},
Expand Down
30 changes: 29 additions & 1 deletion .vscode/launch.linux.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,34 @@
}
]
},
{
"name": "Tests Extension",
"preLaunchTask": "Build Only (debug)",
"program": "${workspaceFolder}/extern/nvidia/_build/target-deps/kit-sdk/kit",
"args": [
"${workspaceFolder}/apps/cesium.omniverse.cpp.tests.runner.kit"
],
"env": {
// Disable LSAN when debugging since it doesn't work with GDB and prints harmless but annoying warning messages
"ASAN_OPTIONS": "detect_leaks=0",
"UBSAN_OPTIONS": "print_stacktrace=1"
},
"cwd": "${workspaceFolder}",
"type": "lldb",
"request": "launch",
"console": "externalTerminal",
"internalConsoleOptions": "openOnSessionStart",
"MIMode": "gdb",
"setupCommands": [
{
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"text": "set print elements 0"
}
]
},
{
"name": "Development App (Kit Debug)",
"preLaunchTask": "Build Only (debug)",
Expand Down Expand Up @@ -174,4 +202,4 @@
"host": "localhost"
}
]
}
}
24 changes: 23 additions & 1 deletion .vscode/launch.windows.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,28 @@
"console": "externalTerminal",
"internalConsoleOptions": "openOnSessionStart"
},
{
"name": "Tests Extension",
"preLaunchTask": "Build Only (debug)",
"program": "${workspaceFolder}/extern/nvidia/_build/target-deps/kit-sdk/kit.exe",
"args": [
"${workspaceFolder}/apps/cesium.omniverse.cpp.tests.runner.kit"
],
"cwd": "${workspaceFolder}",
"type": "cppvsdbg",
"request": "launch",
"console": "externalTerminal",
"internalConsoleOptions": "openOnSessionStart",
"setupCommands": [
{
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"text": "set print elements 0"
}
]
},
{
"name": "Python Debugging (start)",
"preLaunchTask": "Build Only (debug)",
Expand All @@ -84,4 +106,4 @@
"host": "localhost"
}
]
}
}
60 changes: 59 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ set(LINT_SOURCE_DIRECTORIES
"${PROJECT_SOURCE_DIR}/src/bindings"
"${PROJECT_SOURCE_DIR}/src/core"
"${PROJECT_SOURCE_DIR}/src/public"
"${PROJECT_SOURCE_DIR}/tests")
"${PROJECT_SOURCE_DIR}/tests"
"${PROJECT_SOURCE_DIR}/cesiumOmniverseCppTestsExtension")

# Source directories for coverage
set(COVERAGE_SOURCE_DIRECTORIES "${PROJECT_SOURCE_DIR}/include" "${PROJECT_SOURCE_DIR}/src")
Expand Down Expand Up @@ -437,6 +438,7 @@ add_subdirectory(src)
if(CESIUM_OMNI_ENABLE_TESTS)
enable_testing()
add_subdirectory(tests)
add_subdirectory(cesiumOmniverseCppTestsExtension)
endif()

# Ninja and various Makefiles generators support generating compile_commands.json
Expand Down Expand Up @@ -511,6 +513,10 @@ set(KIT_EXTENSION_BINDINGS_PATH "${PROJECT_SOURCE_DIR}/exts/cesium.omniverse/ces
set(KIT_PLUGIN_EXTENSION_BINDINGS_PATH "${PROJECT_SOURCE_DIR}/exts/cesium.usd.plugins/cesium/usd/plugins")
set(KIT_EXTENSION_PLUGINS_PATH "${PROJECT_SOURCE_DIR}/exts/cesium.usd.plugins/plugins")

set(KIT_EXTENSION_TESTS_BIN_PATH "${PROJECT_SOURCE_DIR}/exts/cesium.omniverse.cpp.tests/bin")
set(KIT_EXTENSION_TESTS_BINDINGS_PATH
"${PROJECT_SOURCE_DIR}/exts/cesium.omniverse.cpp.tests/cesium/omniverse/cpp/tests/bindings")

# You may see warnings like:
#
# CMake Warning at build/src/cmake_install.cmake:115 (file):
Expand Down Expand Up @@ -663,6 +669,58 @@ install(
COMPONENT library
EXCLUDE_FROM_ALL)


if(CESIUM_OMNI_ENABLE_TESTS)
install(
TARGETS cesium.omniverse.cpp.tests.plugin
ARCHIVE DESTINATION ${KIT_EXTENSION_TESTS_BIN_PATH} COMPONENT install
LIBRARY DESTINATION ${KIT_EXTENSION_TESTS_BIN_PATH} COMPONENT install
RUNTIME DESTINATION ${KIT_EXTENSION_TESTS_BIN_PATH} COMPONENT install)
install(
TARGETS cesium.omniverse.cpp.tests.plugin
RUNTIME_DEPENDENCIES
DIRECTORIES
${INSTALL_SEARCH_PATHS}
PRE_EXCLUDE_REGEXES
${INSTALL_PRE_EXCLUDE_REGEXES}
POST_EXCLUDE_REGEXES
${INSTALL_POST_EXCLUDE_REGEXES}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT library
EXCLUDE_FROM_ALL
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT library
EXCLUDE_FROM_ALL
RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT library
EXCLUDE_FROM_ALL)

install(
TARGETS CesiumOmniverseCppTestsPythonBindings
ARCHIVE DESTINATION ${KIT_EXTENSION_TESTS_BINDINGS_PATH} COMPONENT install
LIBRARY DESTINATION ${KIT_EXTENSION_TESTS_BINDINGS_PATH} COMPONENT install
RUNTIME DESTINATION ${KIT_EXTENSION_TESTS_BINDINGS_PATH} COMPONENT install)

install(
TARGETS CesiumOmniverseCppTestsPythonBindings
RUNTIME_DEPENDENCIES
DIRECTORIES
${INSTALL_SEARCH_PATHS}
PRE_EXCLUDE_REGEXES
${INSTALL_PRE_EXCLUDE_REGEXES}
POST_EXCLUDE_REGEXES
${INSTALL_POST_EXCLUDE_REGEXES}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT library
EXCLUDE_FROM_ALL
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT library
EXCLUDE_FROM_ALL
RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT library
EXCLUDE_FROM_ALL)
endif()

install(
DIRECTORY "${PROJECT_SOURCE_DIR}/include/"
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
Expand Down
19 changes: 19 additions & 0 deletions apps/cesium.omniverse.cpp.tests.runner.kit
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[package]
title = "Cesium For Omniverse Tests App"
version = "0.0.0"
app = true

[dependencies]
"cesium.omniverse.dev" = {}
"cesium.omniverse.cpp.tests" = {}

[settings]
app.window.title = "Cesium for Omniverse Tests App"

[settings.app.exts]
folders.'++' = [
"${app}", # Find other applications in this folder
"${app}/exts", # Find extensions in this folder
"${app}/../exts", # Find cesium.omniverse and cesium.usd.schemas
"${app}/../extern/nvidia/app/extscache" # Find omni.kit.window.material_graph
]
2 changes: 2 additions & 0 deletions cesiumOmniverseCppTestsExtension/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
add_subdirectory(bindings)
add_subdirectory(public)
25 changes: 25 additions & 0 deletions cesiumOmniverseCppTestsExtension/bindings/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
include(Macros)

glob_files(SOURCES "${CMAKE_CURRENT_LIST_DIR}/*.cpp")

# cmake-format: off
setup_python_module(
PYTHON_DIR
# Use the same Python version as Omniverse (Python 3.10)
"${PROJECT_SOURCE_DIR}/extern/nvidia/_build/target-deps/python"
TARGET_NAME
CesiumOmniverseCppTestsPythonBindings
SOURCES
${SOURCES}
LIBRARIES
cesium.omniverse.cpp.tests.plugin
CXX_FLAGS
${CESIUM_OMNI_CXX_FLAGS}
CXX_FLAGS_DEBUG
${CESIUM_OMNI_CXX_FLAGS_DEBUG}
CXX_DEFINES
${CESIUM_OMNI_CXX_DEFINES}
CXX_DEFINES_DEBUG
${CESIUM_OMNI_CXX_DEFINES_DEBUG}
)
# cmake-format: on
22 changes: 22 additions & 0 deletions cesiumOmniverseCppTestsExtension/bindings/PythonBindings.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#include "CesiumOmniverseCppTests.h"

#include <carb/BindingsPythonUtils.h>

// NOLINTNEXTLINE
CARB_BINDINGS("cesium.omniverse.cpp.tests.python")
DISABLE_PYBIND11_DYNAMIC_CAST(cesium::omniverse::tests::ICesiumOmniverseCppTestsInterface)

PYBIND11_MODULE(CesiumOmniverseCppTestsPythonBindings, m) {

using namespace cesium::omniverse::tests;

m.doc() = "pybind11 cesium.omniverse.cpp.tests bindings";

// clang-format off
carb::defineInterfaceClass<ICesiumOmniverseCppTestsInterface>(
m, "ICesiumOmniverseCppTestsInterface", "acquire_cesium_omniverse_tests_interface", "release_cesium_omniverse_tests_interface")
.def("run_all_tests", &ICesiumOmniverseCppTestsInterface::run_all_tests)
.def("on_startup", &ICesiumOmniverseCppTestsInterface::onStartup)
.def("on_shutdown", &ICesiumOmniverseCppTestsInterface::onShutdown);
// clang-format on
}
24 changes: 24 additions & 0 deletions cesiumOmniverseCppTestsExtension/include/CesiumOmniverseCppTests.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#pragma once
#include <carb/Interface.h>

namespace cesium::omniverse::tests {

class ICesiumOmniverseCppTestsInterface {
public:
CARB_PLUGIN_INTERFACE("cesium::omniverse::tests::ICesiumOmniverseCppTestsInterface", 0, 0);
/**
* @brief Call this on extension startup.
*
* @param cesiumExtensionLocation Path to the Cesium Omniverse extension location.
*/
virtual void onStartup(const char* cesiumExtensionLocation) noexcept = 0;

/**
* @brief Call this on extension shutdown.
*/
virtual void onShutdown() noexcept = 0;

virtual void run_all_tests(long int stage_id) noexcept = 0;
};

} // namespace cesium::omniverse::tests
Loading

0 comments on commit 7f5464a

Please sign in to comment.