Quellcode durchsuchen

Add PALification code to restrict this gem to only build on Linux (for now) (#298)

Signed-off-by: Steve Pham <[email protected]>
Steve Pham vor 2 Jahren
Ursprung
Commit
2bd47cfba1

+ 9 - 1
Gems/ROS2/Code/CMakeLists.txt

@@ -3,10 +3,18 @@
 #
 # SPDX-License-Identifier: Apache-2.0 OR MIT
 
-# If no ROS2 is found, no targets are valid for this Gem
 
+# Only allow this gem to be configured on platforms that are currently supported
+include(${CMAKE_CURRENT_SOURCE_DIR}/Platform/${PAL_PLATFORM_NAME}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake)
+if(NOT PAL_TRAIT_BUILD_ROS2_GEM_SUPPORTED)
+    message(FATAL_ERROR "The ROS2 Gem is not currently supported on ${PAL_PLATFORM_NAME}")
+    return()
+endif()
+
+# If no ROS2 is found, no targets are valid for this Gem
 find_package(ROS2 MODULE)
 if (NOT ROS2_FOUND)
+    message(FATAL_ERROR "Unable to detect a the ROS2 distribution on this system. Make sure it is installed and enabled.")
     return()
 endif()
 

+ 9 - 0
Gems/ROS2/Code/Platform/Android/PAL_android.cmake

@@ -0,0 +1,9 @@
+#
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+#
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+#
+
+set(PAL_TRAIT_BUILD_ROS2_GEM_SUPPORTED FALSE)

+ 9 - 0
Gems/ROS2/Code/Platform/Linux/PAL_linux.cmake

@@ -0,0 +1,9 @@
+#
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+#
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+#
+
+set(PAL_TRAIT_BUILD_ROS2_GEM_SUPPORTED TRUE)

+ 9 - 0
Gems/ROS2/Code/Platform/Mac/PAL_mac.cmake

@@ -0,0 +1,9 @@
+#
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+#
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+#
+
+set(PAL_TRAIT_BUILD_ROS2_GEM_SUPPORTED FALSE)

+ 9 - 0
Gems/ROS2/Code/Platform/Windows/PAL_windows.cmake

@@ -0,0 +1,9 @@
+#
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+#
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+#
+
+set(PAL_TRAIT_BUILD_ROS2_GEM_SUPPORTED FALSE)

+ 9 - 0
Gems/ROS2/Code/Platform/iOS/PAL_ios.cmake

@@ -0,0 +1,9 @@
+#
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+#
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+#
+
+set(PAL_TRAIT_BUILD_ROS2_GEM_SUPPORTED FALSE)