summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorHarsh Aggarwal (NVIDIA) <haaggarwal@nvidia.com>2025-06-19 15:31:25 +0530
committerGitHub <noreply@github.com>2025-06-19 10:01:25 +0000
commit23dcea810a79e19051e70ff2aa0b8953429c6461 (patch)
tree2143cbc00288bbb1f2791aef0547f3eb53f801d4 /cmake
parent5da7301d19e0a293bc2187520b471361beaefe92 (diff)
Enabling optix ci pipeline (#7311)
* Revert "Disable OptiX tests by default. (#1331)" This reverts commit e45f8c1f49855cebe90b6722324ec24146ff5a3d. * Enable optix submodule to build Add support for default entry points in compilation Implemented logic to check for defined entry points in the module when no explicit entry points are provided. If found, these entry points are added to the `specializedEntryPoints` list, with the assumption that no specialization is needed for them at this time. * Disable optix if cuda is not enabled * Add submodule OptixSDK path in search * Distinguish user-explicit vs auto-detected SLANG_ENABLE_OPTIX When SLANG_ENABLE_OPTIX is explicitly set by user and CUDA is not available, show SEND_ERROR to maintain strict validation. When OptiX is auto-detected (e.g., local submodule present) but CUDA unavailable, gracefully disable with STATUS message to allow builds to continue. This addresses review feedback to keep error for explicit requests while handling auto-detection gracefully. * Apply CMake formatting to SLANG_ENABLE_OPTIX validation logic * revert: slang-rhi changes as those are merged independently as in PR # slang-rhi#400
Diffstat (limited to 'cmake')
-rw-r--r--cmake/FindOptiX.cmake16
1 files changed, 14 insertions, 2 deletions
diff --git a/cmake/FindOptiX.cmake b/cmake/FindOptiX.cmake
index d036c4fef..38c64b4c8 100644
--- a/cmake/FindOptiX.cmake
+++ b/cmake/FindOptiX.cmake
@@ -1,6 +1,15 @@
set(Optix_ROOT_DIR "" CACHE PATH "Path to an installed OptiX SDK")
-if(Optix_ROOT_DIR)
+# First try the git submodule location
+find_path(
+ OptiX_INCLUDE_DIRS
+ NAMES optix.h
+ PATHS "${CMAKE_CURRENT_SOURCE_DIR}/external/optix-dev/include"
+ NO_DEFAULT_PATH
+)
+
+# If not found and a custom path is provided, try that
+if(NOT OptiX_INCLUDE_DIRS AND Optix_ROOT_DIR)
find_path(
OptiX_INCLUDE_DIRS
NAMES optix.h
@@ -8,7 +17,10 @@ if(Optix_ROOT_DIR)
PATHS "${Optix_ROOT_DIR}"
NO_DEFAULT_PATH
)
-else()
+endif()
+
+# Finally, try system paths as fallback
+if(NOT OptiX_INCLUDE_DIRS)
find_path(OptiX_INCLUDE_DIRS NAMES optix.h)
endif()