···229229cmake_dependent_option(XRT_BUILD_DRIVER_REMOTE "Enable remote debugging driver" ON "XRT_HAVE_LINUX OR ANDROID" OFF)
230230option(XRT_BUILD_DRIVER_WMR "Enable Windows Mixed Reality driver" ON)
231231232232+option(XRT_BUILD_SAMPLES "Enable compiling sample code implementations that will not be linked into any final targets" ON)
233233+232234# These all use the Monado internal hid wrapper.
233235cmake_dependent_option(XRT_BUILD_DRIVER_HDK "Enable HDK driver" ON "XRT_HAVE_INTERNAL_HID" OFF)
234236cmake_dependent_option(XRT_BUILD_DRIVER_PSMV "Enable Playstation Move driver" ON "XRT_HAVE_INTERNAL_HID" OFF)
+9-6
src/xrt/drivers/CMakeLists.txt
···296296 list(APPEND ENABLED_DRIVERS euroc)
297297endif()
298298299299-# We always build the sample driver, to make sure it stays valid, but it never gets linked
300300-add_library(drv_sample STATIC
301301- sample/sample_hmd.c
302302- sample/sample_interface.h
303303- sample/sample_prober.c)
304304-target_link_libraries(drv_sample PRIVATE xrt-interfaces aux_util)
299299+if(XRT_BUILD_SAMPLES)
300300+ # We build the sample driver to make sure it stays valid,
301301+ # but it never gets linked into a final target.
302302+ add_library(drv_sample STATIC
303303+ sample/sample_hmd.c
304304+ sample/sample_interface.h
305305+ sample/sample_prober.c)
306306+ target_link_libraries(drv_sample PRIVATE xrt-interfaces aux_util)
307307+endif()
305308306309if(ENABLED_HEADSET_DRIVERS)
307310 set(ENABLED_DRIVERS ${ENABLED_HEADSET_DRIVERS} ${ENABLED_DRIVERS})