Commit 334d62df authored by Ryan Pavlik's avatar Ryan Pavlik
Browse files

build: Only show the XRT_BUILD_ defines where they're needed.

parent 80cf6163
......@@ -72,6 +72,10 @@ endif()
# Flags
###
# This "library" provides the preprocessor definitions for enabled drivers:
# XRT_BUILD_ + some driver-specific string
add_library(monado-driver-defines INTERFACE)
if(BUILD_WITH_LIBUDEV)
add_definitions(-DXRT_HAVE_LIBUDEV)
endif()
......@@ -96,7 +100,7 @@ if(BUILD_WITH_OPENHMD)
add_definitions(-DXRT_HAVE_OPENHMD)
# Drivers enabled with OpenHMD.
add_definitions(-DXRT_BUILD_OHMD)
target_compile_definitions(monado-driver-defines INTERFACE XRT_BUILD_OHMD)
set(BUILD_DRIVER_OHMD TRUE)
endif()
......@@ -104,15 +108,15 @@ if(BUILD_WITH_HIDAPI)
add_definitions(-DXRT_HAVE_HIDAPI)
# Drivers enabled with hidapi.
add_definitions(-DXRT_BUILD_HDK)
target_compile_definitions(monado-driver-defines INTERFACE XRT_BUILD_HDK)
set(BUILD_DRIVER_HDK TRUE)
add_definitions(-DXRT_BUILD_PSVR)
target_compile_definitions(monado-driver-defines INTERFACE XRT_BUILD_PSVR)
set(BUILD_DRIVER_PSVR TRUE)
endif()
if(TRUE)
# Uses the Monado internal hid wrapper.
add_definitions(-DXRT_BUILD_PSMV)
target_compile_definitions(monado-driver-defines INTERFACE XRT_BUILD_PSMV)
set(BUILD_DRIVER_PSMV TRUE)
endif()
......
......@@ -12,5 +12,6 @@ set(SOURCE_FILES
)
add_library(target_lists OBJECT ${SOURCE_FILES})
target_link_libraries(target_lists PRIVATE monado-driver-defines)
set_property(TARGET target_lists PROPERTY POSITION_INDEPENDENT_CODE ON)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment