Skip to content

Commit 7e1eccd

Browse files
jfpanissetlgritz
authored andcommitted
build: Serialize builds in testshade (#2012)
When building with: - OptiX enabled (OSL_USE_OPTIX) - Code Coverage disabled (NOT CODECOV) - a parallel build various components of the clang toolchain are likely to crash as the testshade and libtestshade builds run in parallel and can overwrite each other's intermediate results. This chain adds explicit dependencies to serialize these builds, avoiding toolchain crashes at a minimal performance cost. --- Signed-off-by: Jean-Francois Panisset <[email protected]>
1 parent 77a8277 commit 7e1eccd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/testshade/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ target_include_directories (testshade BEFORE PRIVATE ${OpenImageIO_INCLUDES})
8282
target_link_libraries (testshade
8383
PRIVATE
8484
oslexec oslquery oslcomp)
85+
if (OSL_USE_OPTIX)
86+
add_dependencies(testshade testshade_ptx)
87+
endif ()
8588

8689
install (TARGETS testshade RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} )
8790

@@ -98,6 +101,7 @@ osl_optix_target(testshade)
98101
if (NOT CODECOV)
99102
# The 'libtestshade' library
100103
add_library ( "libtestshade" ${testshade_srcs} )
104+
add_dependencies(libtestshade testshade)
101105

102106
set_target_properties (libtestshade
103107
PROPERTIES

0 commit comments

Comments
 (0)