|
@@ -470,16 +470,19 @@ macro(legacy_check)
|
|
|
endif()
|
|
endif()
|
|
|
endmacro()
|
|
endmacro()
|
|
|
|
|
|
|
|
-# add_obs_plugin: Add plugin subdirectory if host platform is in specified list of supported platforms
|
|
|
|
|
|
|
+# add_obs_plugin: Add plugin subdirectory if host platform is in specified list of supported platforms and architectures
|
|
|
function(add_obs_plugin target)
|
|
function(add_obs_plugin target)
|
|
|
set(options WITH_MESSAGE)
|
|
set(options WITH_MESSAGE)
|
|
|
set(oneValueArgs "")
|
|
set(oneValueArgs "")
|
|
|
- set(multiValueArgs PLATFORMS)
|
|
|
|
|
|
|
+ set(multiValueArgs PLATFORMS ARCHITECTURES)
|
|
|
cmake_parse_arguments(PARSE_ARGV 0 _AOP "${options}" "${oneValueArgs}" "${multiValueArgs}")
|
|
cmake_parse_arguments(PARSE_ARGV 0 _AOP "${options}" "${oneValueArgs}" "${multiValueArgs}")
|
|
|
|
|
|
|
|
set(found_platform FALSE)
|
|
set(found_platform FALSE)
|
|
|
list(LENGTH _AOP_PLATFORMS _AOP_NUM_PLATFORMS)
|
|
list(LENGTH _AOP_PLATFORMS _AOP_NUM_PLATFORMS)
|
|
|
|
|
|
|
|
|
|
+ set(found_architecture FALSE)
|
|
|
|
|
+ list(LENGTH _AOP_ARCHITECTURES _AOP_NUM_ARCHITECTURES)
|
|
|
|
|
+
|
|
|
if(_AOP_NUM_PLATFORMS EQUAL 0)
|
|
if(_AOP_NUM_PLATFORMS EQUAL 0)
|
|
|
set(found_platform TRUE)
|
|
set(found_platform TRUE)
|
|
|
else()
|
|
else()
|
|
@@ -492,7 +495,25 @@ function(add_obs_plugin target)
|
|
|
endforeach()
|
|
endforeach()
|
|
|
endif()
|
|
endif()
|
|
|
|
|
|
|
|
- if(found_platform)
|
|
|
|
|
|
|
+ if(_AOP_NUM_ARCHITECTURES EQUAL 0)
|
|
|
|
|
+ set(found_architecture TRUE)
|
|
|
|
|
+ else()
|
|
|
|
|
+ foreach(architecture IN LISTS _AOP_ARCHITECTURES)
|
|
|
|
|
+ if(OS_WINDOWS)
|
|
|
|
|
+ if("${architecture}" STREQUAL CMAKE_GENERATOR_PLATFORM)
|
|
|
|
|
+ set(found_architecture TRUE)
|
|
|
|
|
+ endif()
|
|
|
|
|
+ elseif(OS_MACOS)
|
|
|
|
|
+ if("${architecture}" IN_LIST CMAKE_OSX_ARCHITECTURES)
|
|
|
|
|
+ set(found_architecture TRUE)
|
|
|
|
|
+ endif()
|
|
|
|
|
+ elseif("${architecture}" STREQUAL CMAKE_SYSTEM_PROCESSOR)
|
|
|
|
|
+ set(found_architecture TRUE)
|
|
|
|
|
+ endif()
|
|
|
|
|
+ endforeach()
|
|
|
|
|
+ endif()
|
|
|
|
|
+
|
|
|
|
|
+ if(found_platform AND found_architecture)
|
|
|
add_subdirectory(${target})
|
|
add_subdirectory(${target})
|
|
|
elseif(_AOP_WITH_MESSAGE)
|
|
elseif(_AOP_WITH_MESSAGE)
|
|
|
add_custom_target(${target} COMMENT "Dummy target for unavailable module ${target}")
|
|
add_custom_target(${target} COMMENT "Dummy target for unavailable module ${target}")
|