### Install Gfxstream on QNX Source: https://github.com/google/gfxstream/blob/main/third_party/qnx/README.md Use 'make install' to install Gfxstream. The INSTALL_ROOT_nto environment variable must be set to specify the installation path. ```bash cd ./qnx make install ``` -------------------------------- ### Start Perfetto Trace Capture Source: https://github.com/google/gfxstream/blob/main/docs/tracing.md Initiates a trace capture using Perfetto. This command requires a configuration file. ```bash ./out/linux/perfetto --txt -c gfxstream_trace.cfg -o gfxstream_trace.perfetto ``` -------------------------------- ### Perfetto Trace Configuration Source: https://github.com/google/gfxstream/blob/main/docs/tracing.md Example configuration for a Perfetto trace, specifying buffer size and enabling track event data source. ```protobuf buffers { size_kb: 4096 } data_sources { config { name: "track_event" track_event_config { } } } ``` -------------------------------- ### Build Gfxstream guest components with Soong Source: https://github.com/google/gfxstream/blob/main/README.md Build guest components for virtual device images using Android's Soong build system. Follow Android development setup instructions first. The output library will be in out/host. ```bash m libgfxstream_backend ``` -------------------------------- ### Start Perfetto Daemon on Linux Source: https://github.com/google/gfxstream/blob/main/docs/tracing.md Starts the Perfetto daemon on Linux, which is required for capturing traces. ```bash ./out/linux/traced ``` -------------------------------- ### Embed Build Info in Binary (QNX) Source: https://github.com/google/gfxstream/blob/main/third_party/qnx/README.md The pinfo.mk script embeds build information directly into the binary. This example shows the format of the embedded information. ```makefile # use -i ./nto/aarch64le/gfxstream/host/libgfxstream_backend.so QNX_BUILDID=(GNU)5dc1327b962ed2a7e992c1f6f35c0df3 NAME=libgfxstream_backend.so DESCRIPTION=virtio-gpu backend renderer DATE=2023/09/18-10:58:49-EDT COMMIT=7b8c19e51845aee014684c43e6aa8409e919af6a ``` -------------------------------- ### Install Shared Library Source: https://github.com/google/gfxstream/blob/main/host/CMakeLists.txt Installs the shared GFXStream backend library to the runtime destination based on the CONFIG_AEMU build configuration. ```cmake if(CONFIG_AEMU) android_install_shared_library(TARGET gfxstream_backend) else() install( TARGETS gfxstream_backend RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX} LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}) endif() ``` -------------------------------- ### Install Perfetto Build Dependencies Source: https://github.com/google/gfxstream/blob/main/docs/tracing.md Installs the necessary build dependencies for Perfetto. Ensure you are in the correct directory within your Android repository. ```bash cd /external/perfetto ./tools/install-build-deps ./tools/gn gen --args='is_debug=false' out/linux ./tools/ninja -C out/linux traced perfetto ``` -------------------------------- ### Start Gfxstream with Cuttlefish Source: https://github.com/google/gfxstream/blob/main/docs/tracing.md Launches Gfxstream using Cuttlefish with a specific GPU mode configuration. ```bash cvd start --gpu_mode=gfxstream_guest_angle_host_swiftshader ``` -------------------------------- ### Set Build Optimizations and Output Directories Source: https://github.com/google/gfxstream/blob/main/CMakeLists.txt Configures interprocedural optimization and sets runtime and library output directories to the binary directory. Also sets the installation prefix. ```cmake set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/distribution) ``` -------------------------------- ### Build Gfxstream with CMake on Windows Source: https://github.com/google/gfxstream/blob/main/README.md Configure the Gfxstream build for Windows using CMake, specifying a 64-bit architecture and Clang compiler. Ensure CMake and Visual Studio 2019 with Clang C++ toolchain are installed. A solution file will be generated. ```bash mkdir build cd build cmake . ../ -A x64 -T ClangCL ``` -------------------------------- ### Configure Google Test Framework Source: https://github.com/google/gfxstream/blob/main/third_party/CMakeLists.txt Configures the Google Test framework, handling dependency resolution for AOSP or system installations. It defines aliases for gtest, gtest_main, gmock, and gmock_main. ```cmake if(NOT TARGET gtest_main AND ENABLE_VKCEREAL_TESTS) # For Windows: Prevent overriding the parent project's compiler/linker settings set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) if(DEPENDENCY_RESOLUTION STREQUAL "AOSP") set(GOOGLETEST_PATH ${PROJECT_SOURCE_DIR}/../../../external/googletest) if(EXISTS ${GOOGLETEST_PATH}) add_subdirectory(${GOOGLETEST_PATH} googletest) endif() elseif(DEPENDENCY_RESOLUTION STREQUAL "SYSTEM") find_package(PkgConfig REQUIRED) pkg_search_module(gtest REQUIRED IMPORTED_TARGET GLOBAL gtest) pkg_search_module(gtest_main REQUIRED IMPORTED_TARGET GLOBAL gtest_main) pkg_search_module(gmock REQUIRED IMPORTED_TARGET GLOBAL gmock) pkg_search_module(gmock_main REQUIRED IMPORTED_TARGET GLOBAL gmock_main) add_library(gtest ALIAS PkgConfig::gtest) add_library(gtest_main ALIAS PkgConfig::gtest_main) add_library(gmock ALIAS PkgConfig::gmock) add_library(gmock_main ALIAS PkgConfig::gmock_main) endif() endif() ``` -------------------------------- ### Build Gfxstream on QNX Source: https://github.com/google/gfxstream/blob/main/third_party/qnx/README.md Navigate to the QNX directory and run 'make' to build Gfxstream. Ensure QNX_TARGET and QNX_HOST are set. ```bash cd ./qnx make ``` -------------------------------- ### Build Gfxstream with Meson on Linux Source: https://github.com/google/gfxstream/blob/main/README.md Build the backend for Linux guest on Linux host use cases using Meson. Configure the build with static libraries and host backend, then compile. Ensure you are in the Gfxstream project directory. ```bash cd meson setup \ -Ddefault_library=static \ -Dgfxstream-build=host \ build meson compile -C build ``` -------------------------------- ### OpenGL Rendering Unit Tests Source: https://github.com/google/gfxstream/blob/main/host/CMakeLists.txt Sets up the executable for basic OpenGL rendering unit tests. Includes multiple test source files and links against various GFXStream and testing libraries. ```cmake add_executable( OpenglRender_unittests frame_buffer_unittest.cpp vsync_thread_unittest.cpp tests/GLES1Dispatch_unittest.cpp tests/DefaultFramebufferBlit_unittest.cpp tests/TextureDraw_unittest.cpp tests/StalePtrRegistry_unittest.cpp ) target_link_libraries( OpenglRender_unittests PRIVATE gfxstream_backend_static gfxstream_common_base gfxstream_common_testenv gfxstream_host_common gfxstream_host_testing_support gmock gtest_main) if (LINUX) target_compile_definitions( OpenglRender_unittests PRIVATE GFXSTREAM_HAS_X11=1) target_link_libraries( OpenglRender_unittests PRIVATE x11_testing_support) endif() discover_tests(OpenglRender_unittests) ``` -------------------------------- ### Adding gfxstream_host_testing_oswindow_support Library Source: https://github.com/google/gfxstream/blob/main/host/testlibs/oswindow/CMakeLists.txt Adds the gfxstream_host_testing_oswindow_support library, including common OSWindow.cpp and platform-specific sources. It also configures public and private include directories. ```cmake add_library( gfxstream_host_testing_oswindow_support OSWindow.cpp ${gfxstream_host_testing_oswindow_support_platform_sources} ) target_include_directories( gfxstream_host_testing_oswindow_support PUBLIC include PRIVATE .) ``` -------------------------------- ### Vulkan Command Buffer Lifecycle and Usage Source: https://github.com/google/gfxstream/blob/main/docs/snapshot.md Demonstrates the creation, allocation, binding, recording, and resetting of Vulkan command buffers and associated resources. This sequence illustrates the state changes over time. ```c++ // Time1 VkImage image1; vkCreateImage(..., &image1); // Time2 VkDeviceMemory memory1; vkAllocateMemory(..., &memory1); // Time3 vkBindImageMemory(image1, memory1); ... // Time4 VkCommandPool commandpool1; vkCreateCommandPool(..., &commandpool1); // Time5 VkCommandBuffer commandbuffer1; vkAllocateCommandBuffers(..., &commandpool1); ... //// Rendering for Frame 1 //// // Time6 vkBeginCommandBuffer(commandbuffer1); // Time7 vkCmdCopyBufferToImage(commandbuffer1, ..., image1); // Time8 vkEndCommandBuffer(commandbuffer1); //// Rendering for Frame 2 //// // Time9 vkResetCommandBuffer(commandbuffer1); // Time10 vkBeginCommandBuffer(commandbuffer1); // Time11 vkCmdCopyBufferToImage(commandbuffer1, ..., image1); // Time12 vkEndCommandBuffer(commandbuffer1); ``` -------------------------------- ### Build all Gfxstream components with Soong Source: https://github.com/google/gfxstream/blob/main/README.md Build all components within the Gfxstream directory using the 'mma' command from within an Android repo. This is useful for validating changes. ```bash cd hardware/google/gfxstream mma ``` -------------------------------- ### Define gfxstream_host_iostream interface library Source: https://github.com/google/gfxstream/blob/main/host/iostream/CMakeLists.txt Creates the gfxstream_host_iostream interface library if it does not already exist, setting up include directories and link dependencies. ```cmake if (NOT TARGET gfxstream_host_iostream) add_library( gfxstream_host_iostream INTERFACE) target_include_directories( gfxstream_host_iostream INTERFACE include) target_link_libraries( gfxstream_host_iostream INTERFACE gfxstream_backend_headers) endif() ``` -------------------------------- ### Run Gfxstream tests with Bazel on Linux Source: https://github.com/google/gfxstream/blob/main/README.md Execute all tests using Bazel or a specific end-to-end test suite. ```bash bazel test ... ``` ```bash bazel test tests/end2end:gfxstream_end2end_tests ``` -------------------------------- ### Run Gfxstream tests with Soong on Linux Source: https://github.com/google/gfxstream/blob/main/README.md Run Gfxstream end-to-end tests on host using the 'atest' command within an Android repo. ```bash atest --host GfxstreamEnd2EndTests ``` -------------------------------- ### Configure Google Benchmark Framework Source: https://github.com/google/gfxstream/blob/main/third_party/CMakeLists.txt Sets up Google's benchmarking framework, disabling exceptions and testing features to optimize build times. Supports dependency resolution via AOSP or system paths. ```cmake if(WITH_BENCHMARK) # Add Google's benchmarking framework set(BENCHMARK_ENABLE_EXCEPTIONS OFF) # We disable exceptions in gfxstream set(BENCHMARK_ENABLE_TESTING OFF) # Don't build the unit tests for the library, to save time set(BENCHMARK_ENABLE_GTEST_TESTS OFF) if(DEPENDENCY_RESOLUTION STREQUAL "AOSP") set(GOOGLE_BENCHMARK_PATH ${PROJECT_SOURCE_DIR}/../../../external/google-benchmark) if(EXISTS ${GOOGLE_BENCHMARK_PATH}) add_subdirectory(${GOOGLE_BENCHMARK_PATH} google-benchmark) endif() elseif(DEPENDENCY_RESOLUTION STREQUAL "SYSTEM") message(FATAL_ERROR "Not implemented") endif() endif() ``` -------------------------------- ### Build Gfxstream with Bazel on Linux Source: https://github.com/google/gfxstream/blob/main/README.md Use Bazel to build the host server for Android virtual device host tooling. Navigate to the Gfxstream project directory before running these commands. ```bash cd bazel build ... bazel test ... ``` -------------------------------- ### Vulkan Unit Tests Configuration Source: https://github.com/google/gfxstream/blob/main/host/CMakeLists.txt Sets up the executable for Vulkan unit tests. Links against Vulkan server, backend, common, and testing libraries. Includes platform-specific definitions for Metal, QNX, and XCB. ```cmake add_executable( Vulkan_unittests virtio_gpu_timelines_tests.cpp vulkan/compositor_vk_unittest.cpp vulkan/display_vk_unittest.cpp vulkan/swap_chain_state_vk_unittest.cpp vulkan/vk_decoder_global_state_unittest.cpp vulkan/vk_emulated_physical_device_memory_tests.cpp vulkan/vk_emulated_physical_device_queue_tests.cpp vulkan/vk_format_utils_unittest.cpp vulkan/vk_qsri_timeline_unittest.cpp vulkan/vk_utils_tests.cpp vulkan/vulkan_unittest.cpp ) target_link_libraries( Vulkan_unittests PRIVATE gfxstream_backend_static gfxstream_common_base gfxstream_common_testenv gfxstream_host_testing_oswindow_support gfxstream_host_testing_support gfxstream-vulkan-server gtest gtest_main gmock) if (APPLE) target_compile_definitions( Vulkan_unittests PRIVATE -DVK_USE_PLATFORM_METAL_EXT) target_link_libraries( Vulkan_unittests PUBLIC "-framework AppKit") endif() discover_tests( Vulkan_unittests WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) if (APPLE) target_compile_definitions(Vulkan_unittests PRIVATE -DVK_USE_PLATFORM_METAL_EXT) elseif (QNX) target_compile_definitions(Vulkan_unittests PRIVATE -DVK_USE_PLATFORM_SCREEN_QNX) elseif (UNIX) target_compile_definitions(Vulkan_unittests PRIVATE -DVK_USE_PLATFORM_XCB_KHR) endif() ``` -------------------------------- ### Configure ASTC CPU Decompressor Library Source: https://github.com/google/gfxstream/blob/main/host/compressed_textures/CMakeLists.txt Sets up the gfxstream_host_compressed_textures library with conditional source selection based on the ASTC_CPU_DECODING flag. ```cmake if (ASTC_CPU_DECODING) set(astc-cpu-decompressor-sources astc_cpu_decompressor_impl.cpp) else() set(astc-cpu-decompressor-sources astc_cpu_decompressor_noop.cpp) endif() add_library( gfxstream_host_compressed_textures ${astc-cpu-decompressor-sources}) target_link_libraries( gfxstream_host_compressed_textures PRIVATE gfxstream_etc) target_include_directories( gfxstream_host_compressed_textures PUBLIC include) ``` -------------------------------- ### Set Include Directories for Host Snapshot Headers Source: https://github.com/google/gfxstream/blob/main/host/snapshot/CMakeLists.txt Specifies the include directories for the gfxstream_host_snapshot.headers interface library. The 'include' directory will be added to the include path. ```cmake target_include_directories( gfxstream_host_snapshot.headers INTERFACE include) ``` -------------------------------- ### Configure Perfetto Tracing Library Source: https://github.com/google/gfxstream/blob/main/third_party/CMakeLists.txt Adds the Perfetto tracing library for host-side tracing when GFXSTREAM_ENABLE_HOST_TRACING is enabled. It requires Perfetto to be present in the AOSP external directory. ```cmake if(GFXSTREAM_ENABLE_HOST_TRACING) if(DEPENDENCY_RESOLUTION STREQUAL "AOSP") set(GFXSTREAM_PERFETTO_PATH ${PROJECT_SOURCE_DIR}/../../../external/perfetto) if(NOT EXISTS ${GFXSTREAM_PERFETTO_PATH}) message(FATAL_ERROR "Perfetto is not found.") endif() add_library(perfetto STATIC ${GFXSTREAM_PERFETTO_PATH}/sdk/perfetto.cc) target_include_directories(perfetto INTERFACE ${GFXSTREAM_PERFETTO_PATH}/sdk) endif() endif() ``` -------------------------------- ### Configure Gfxstream Test Environment Library Source: https://github.com/google/gfxstream/blob/main/common/testenv/CMakeLists.txt Defines the interface headers and the main test environment library with its required dependencies. ```cmake add_library( gfxstream_common_testenv.headers INTERFACE) target_include_directories( gfxstream_common_testenv.headers INTERFACE include) add_library( gfxstream_common_testenv graphics_test_environment.cpp) target_link_libraries( gfxstream_common_testenv PUBLIC gfxstream_common_base gfxstream_common_logging gfxstream_common_testenv.headers) ``` -------------------------------- ### Configure macOS Architecture and Backends Source: https://github.com/google/gfxstream/blob/main/third_party/astc-encoder/CMakeLists.txt Handles architecture detection and validates backend counts for macOS universal or single-architecture builds. ```cmake if("${MACOS_BUILD}") list(FIND CMAKE_OSX_ARCHITECTURES "x86_64" IS_X64) list(FIND CMAKE_OSX_ARCHITECTURES "arm64" IS_ARM64) list(FIND CMAKE_OSX_ARCHITECTURES "$(ARCHS_STANDARD)" IS_AUTO) # Turn list index into boolean if(${IS_X64} EQUAL -1) set(IS_X64 OFF) else() set(IS_X64 ON) endif() if(${IS_ARM64} EQUAL -1) set(IS_ARM64 OFF) else() set(IS_ARM64 ON) endif() if(${IS_AUTO} EQUAL -1) set(IS_AUTO OFF) else() set(IS_AUTO ON) endif() # Set up defaults if no more specific ISA set - use XCode's own defaults if((IS_ARM64 OR IS_AUTO) AND ("${ARM64_ISA_COUNT}" EQUAL 0) AND (NOT "${ISA_NONE}")) set(ARM64_ISA_COUNT 1) set(ISA_NEON ON) endif() if((IS_X64 OR IS_AUTO) AND ("${X64_ISA_COUNT}" EQUAL 0) AND (NOT "${ISA_NONE}")) set(X64_ISA_COUNT 1) set(ISA_SSE41 ON) endif() # User might be doing multi-architecture - XCode sets this at runtime if("${IS_AUTO}") if(("${ARM64_ISA_COUNT}" GREATER 1) OR ("${X64_ISA_COUNT}" GREATER 1)) message(FATAL_ERROR "For macOS universal binaries only one backend per architecture is allowed.") endif() set(UNIVERSAL_BUILD ON) # User requested explicit multi-architecture universal build elseif("${MACOS_ARCH_LEN}" GREATER 2) message(FATAL_ERROR "For macOS universal binaries only x86_64 and arm64 builds are allowed.") elseif("${MACOS_ARCH_LEN}" EQUAL 2) if(NOT (${IS_X64} AND ${IS_ARM64})) message(FATAL_ERROR "For macOS universal binaries only x86_64 and arm64 builds are allowed.") endif() if(("${ARM64_ISA_COUNT}" GREATER 1) OR ("${X64_ISA_COUNT}" GREATER 1)) message(FATAL_ERROR "For macOS universal binaries only one backend per architecture is allowed.") endif() set(UNIVERSAL_BUILD ON) # User requested explicit single architecture build elseif("${MACOS_ARCH_LEN}" EQUAL 1) if("${IS_X64}" AND "${ARM64_ISA_COUNT}") message(FATAL_ERROR "For macOS x86_64 builds an arm64 backend cannot be specified.") endif() if("${IS_ARM64}" AND "${X64_ISA_COUNT}") message(FATAL_ERROR "For macOS arm64 builds an x86_64 backend cannot be specified.") endif() # Else is this a implicit multi-architecture universal build? elseif(("${ARM64_ISA_COUNT}" EQUAL 1) AND ("${X64_ISA_COUNT}" GREATER 1)) string(CONCAT MSG "For macOS setting multiple architecture backends builds a universal binary. " "For universal binaries only one backend per architecture is allowed.") message(FATAL_ERROR "${MSG}") elseif(("${X64_ISA_COUNT}" EQUAL 1) AND ("${ARM64_ISA_COUNT}" GREATER 1)) string(CONCAT MSG "For macOS setting multiple architecture backends builds a universal binary. " "For universal binaries only one backend per architecture is allowed.") message(FATAL_ERROR "${MSG}") elseif(("${ARM64_ISA_COUNT}" EQUAL 1) AND ("${X64_ISA_COUNT}" EQUAL 1)) set(UNIVERSAL_BUILD ON) set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64") # Else is this an implicit single architecture build? elseif("${ARM64_ISA_COUNT}" EQUAL 1) set(CMAKE_OSX_ARCHITECTURES "arm64") elseif("${X64_ISA_COUNT}" EQUAL 1) set(CMAKE_OSX_ARCHITECTURES "x86_64") else() # Do nothing here - assume it defaults to host? endif() # Non-macOS builds else() if(("${ARM64_ISA_COUNT}" GREATER 0) AND ("${X64_ISA_COUNT}" GREATER 0)) message(FATAL_ERROR "Builds can only support a single architecture per configure.") endif() endif() ``` -------------------------------- ### Log Build Options Source: https://github.com/google/gfxstream/blob/main/third_party/astc-encoder/CMakeLists.txt Helper function and logic to print the status of various build options to the console. ```cmake function(printopt optName optVal) if(${optVal}) message(STATUS " ${optName} - ON") else() message(STATUS " ${optName} - OFF") endif() endfunction() if("${BLOCK_MAX_TEXELS}") message(STATUS " Max block texels - ${BLOCK_MAX_TEXELS}") endif() printopt("AVX2 backend " ${ISA_AVX2}) printopt("SSE4.1 backend " ${ISA_SSE41}) printopt("SSE2 backend " ${ISA_SSE2}) printopt("NEON backend " ${ISA_NEON}) printopt("NONE backend " ${ISA_NONE}) printopt("NATIVE backend " ${ISA_NATIVE}) if("${MACOS_BUILD}") printopt("Universal bin " ${UNIVERSAL_BUILD}) endif() printopt("Decompressor " ${DECOMPRESSOR}) printopt("No invariance " ${NO_INVARIANCE}) printopt("Diagnostics " ${DIAGNOSTICS}) printopt("ASAN " ${ASAN}) printopt("Unit tests " ${UNITTEST}) ``` -------------------------------- ### Build Gfxstream with CMake on Linux Source: https://github.com/google/gfxstream/blob/main/README.md Build the host backend for Goldfish using CMake. This can be done from a standalone Gfxstream checkout or within an Android repo. Ensure you are in the build directory. ```bash mkdir build cd build cmake .. -G Ninja ninja ``` -------------------------------- ### Vulkan Object Creation Sequence Source: https://github.com/google/gfxstream/blob/main/docs/snapshot.md Illustrates a sequence of Vulkan API calls for creating and managing objects like instances, devices, images, and memory, up to the point of binding image memory. ```c++ // Time1 VkInstance instance1; vkCreateInstace(..., &instance1); // Time2 VkPhysicalDevice physicaldevice1; vkEnumeratePhysicalDevices(..., &physicaldevice1); // Time3 VkDevice device1; vkCreateDevice(..., &device1); ... // Time4 VkImage image1; vkCreateImage(..., &image1); // Time5 VkDeviceMemory memory1; vkAllocateMemory(..., &memory1); // Time6 vkBindImageMemory(image1, memory1); ... ``` -------------------------------- ### Include Directories for Compatibility Library Source: https://github.com/google/gfxstream/blob/main/common/base/windows/CMakeLists.txt Sets the public include directories for the gfxstream_common_base_windows_compat library, making its headers accessible during compilation. ```cmake target_include_directories( gfxstream_common_base_windows_compat PUBLIC includes) ``` -------------------------------- ### Include Directories for GLES_CM_translator_static Source: https://github.com/google/gfxstream/blob/main/host/gl/glestranslator/gles_cm/CMakeLists.txt Configures the include directories for the GLES_CM_translator_static library. ```cmake target_include_directories( GLES_CM_translator_static PRIVATE ${GFXSTREAM_REPO_ROOT} ${GFXSTREAM_REPO_ROOT}/host/ ${GFXSTREAM_REPO_ROOT}/host/gl/glestranslator/include ${GFXSTREAM_REPO_ROOT}/third_party/glm/include) ``` -------------------------------- ### GFXStream Backend Unit Tests Source: https://github.com/google/gfxstream/blob/main/host/CMakeLists.txt Configures the executable for GFXStream backend unit tests. Links against core backend, OS window support, base libraries, and Google Test. ```cmake add_executable( gfxstream_backend_unittests gfxstream_unittest.cpp) target_link_libraries( gfxstream_backend_unittests PRIVATE gfxstream_backend gfxstream_host_testing_oswindow_support ${GFXSTREAM_BASE_LIB} gtest_main) discover_tests(gfxstream_backend_unittests) ``` -------------------------------- ### Include Directories for Static Backend Source: https://github.com/google/gfxstream/blob/main/host/CMakeLists.txt Sets the public include directories for the static GFXStream backend library. This allows the compiler to find header files in various subdirectories. ```cmake target_include_directories( gfxstream_backend_static PUBLIC ${GFXSTREAM_REPO_ROOT} ${GFXSTREAM_REPO_ROOT}/host ${GFXSTREAM_REPO_ROOT}/host/include ${GFXSTREAM_REPO_ROOT}/host/gfxstream_host_decoder_common ${GFXSTREAM_REPO_ROOT}/host/gl ${GFXSTREAM_REPO_ROOT}/host/gl/glestranslator/include ${GFXSTREAM_REPO_ROOT}/host/vulkan ${GFXSTREAM_REPO_ROOT}/host/vulkan/cereal/common ) ``` -------------------------------- ### Add GFXStream Host Testing Library Source: https://github.com/google/gfxstream/blob/main/host/testlibs/support/CMakeLists.txt Defines the main host testing support library, including source files and dependencies. This is used for general host-side testing functionalities. ```cmake add_library( gfxstream_host_testing_support GLSnapshotTestDispatch.cpp GLSnapshotTesting.cpp GLSnapshotTestStateUtils.cpp GLTestUtils.cpp HelloTriangleImp.cpp OpenGLTestContext.cpp SampleApplication.cpp ShaderUtils.cpp ) target_include_directories( gfxstream_host_testing_support PUBLIC include ${GFXSTREAM_REPO_ROOT} ${GFXSTREAM_REPO_ROOT}/host ${GFXSTREAM_REPO_ROOT}/host/gl/glestranslator/gles_cm ${GFXSTREAM_REPO_ROOT}/host/gl/glestranslator/include ${GFXSTREAM_REPO_ROOT}/host/gfxstream_host_decoder_common ${GFXSTREAM_REPO_ROOT}/host/vulkan ) target_link_libraries( gfxstream_host_testing_support PUBLIC gfxstream_common_image gfxstream_backend_static gfxstream_host_testing_oswindow_support gfxstream_stb gtest ) ``` -------------------------------- ### Define gfxstream_drm_headers Interface Library Source: https://github.com/google/gfxstream/blob/main/third_party/drm/CMakeLists.txt Creates an interface library and sets the include directory for targets depending on gfxstream_drm_headers. ```cmake add_library( gfxstream_drm_headers INTERFACE) target_include_directories( gfxstream_drm_headers INTERFACE include) ``` -------------------------------- ### Define CMake library and include directories Source: https://github.com/google/gfxstream/blob/main/common/image/CMakeLists.txt Configures the interface headers and source files for the gfxstream_common_image library. ```cmake add_library( gfxstream_common_image.headers INTERFACE) target_include_directories( gfxstream_common_image.headers INTERFACE include) add_library( gfxstream_common_image image_utils.cpp) target_link_libraries( gfxstream_common_image PUBLIC gfxstream_stb gfxstream_common_image.headers) ``` -------------------------------- ### OpenGL Snapshot Unit Tests Source: https://github.com/google/gfxstream/blob/main/host/CMakeLists.txt Configures the executable for OpenGL snapshot-based unit tests. Links against testing support, static backend, and common GFXStream libraries. ```cmake add_executable( OpenglRender_snapshot_unittests tests/GLSnapshotBuffers_unittest.cpp tests/GLSnapshotFramebufferControl_unittest.cpp tests/GLSnapshotFramebuffers_unittest.cpp tests/GLSnapshotMultisampling_unittest.cpp tests/GLSnapshotPixelOperations_unittest.cpp tests/GLSnapshotPixels_unittest.cpp tests/GLSnapshotPrograms_unittest.cpp tests/GLSnapshotRasterization_unittest.cpp tests/GLSnapshotRenderbuffers_unittest.cpp tests/GLSnapshotRendering_unittest.cpp tests/GLSnapshotShaders_unittest.cpp tests/GLSnapshotTextures_unittest.cpp tests/GLSnapshotTransformation_unittest.cpp tests/GLSnapshotVertexAttributes_unittest.cpp tests/GLSnapshot_unittest.cpp) target_link_libraries( OpenglRender_snapshot_unittests PRIVATE gfxstream_host_testing_support gfxstream_backend_static gfxstream_common_base gfxstream_host_common gtest_main) discover_tests(OpenglRender_snapshot_unittests) ``` -------------------------------- ### Link Libraries for Host Snapshot Headers Source: https://github.com/google/gfxstream/blob/main/host/snapshot/CMakeLists.txt Links the gfxstream_backend_headers library to the gfxstream_host_snapshot.headers interface library. This ensures that backend headers are available when using this interface. ```cmake target_link_libraries( gfxstream_host_snapshot.headers INTERFACE gfxstream_backend_headers) ``` -------------------------------- ### Configure gfxstream_common_logging library Source: https://github.com/google/gfxstream/blob/main/common/logging/CMakeLists.txt Defines the library target and includes the public header directory. ```cmake add_library( gfxstream_common_logging logging.cpp) target_include_directories( gfxstream_common_logging PUBLIC include) ``` -------------------------------- ### Configure CPack Package Archive Source: https://github.com/google/gfxstream/blob/main/third_party/astc-encoder/CMakeLists.txt Sets up package naming, checksums, and the ZIP generator. Must be included after CPack configuration variables are defined. ```cmake if(PACKAGE) if("${MACOS_BUILD}") string(TOLOWER "macOS" PKG_OS) else() string(TOLOWER ${CMAKE_SYSTEM_NAME} PKG_OS) endif() set(CPACK_PACKAGE_FILE_NAME "astcenc-${CMAKE_PROJECT_VERSION}-${PKG_OS}-${PACKAGE}") set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY FALSE) set(CPACK_PACKAGE_CHECKSUM SHA256) set(CPACK_GENERATOR ZIP) include(CPack) # Must be included after CPack configuration. endif() ``` -------------------------------- ### Configure GFXStream Host Tracing Library Source: https://github.com/google/gfxstream/blob/main/host/tracing/CMakeLists.txt This CMake code defines a library for host tracing headers and the main tracing implementation. It conditionally links the perfetto library if host tracing is enabled. ```cmake if (NOT TARGET gfxstream_host_tracing) add_library( gfxstream_host_tracing.headers INTERFACE) target_include_directories( gfxstream_host_tracing.headers INTERFACE include) add_library( gfxstream_host_tracing tracing.cpp) target_link_libraries( gfxstream_host_tracing PUBLIC gfxstream_host_tracing.headers) if(GFXSTREAM_ENABLE_HOST_TRACING) target_link_libraries( gfxstream_host_tracing PUBLIC perfetto) endif() endif() ``` -------------------------------- ### Define Gfxstream RenderDoc Interface Library Source: https://github.com/google/gfxstream/blob/main/host/renderdoc/CMakeLists.txt Configures the interface library and its required include directories and linked libraries. ```cmake add_library( gfxstream_host_renderdoc INTERFACE) target_include_directories( gfxstream_host_renderdoc INTERFACE include) target_link_libraries( gfxstream_host_renderdoc INTERFACE renderdoc gfxstream_vulkan_headers gfxstream_xcb_headers ) ``` -------------------------------- ### Enable Unit Testing Source: https://github.com/google/gfxstream/blob/main/third_party/astc-encoder/Source/CMakeLists.txt Configures GoogleTest and enables testing if the UNITTEST flag is set. ```cmake if(${UNITTEST}) set(INSTALL_GTEST OFF CACHE BOOL "" FORCE) add_subdirectory(GoogleTest) enable_testing() add_subdirectory(UnitTest) endif() ``` -------------------------------- ### Platform-Specific Source Files for OSWindow Support Source: https://github.com/google/gfxstream/blob/main/host/testlibs/oswindow/CMakeLists.txt Selects platform-specific source files for OSWindow support based on the detected operating system. This ensures the correct implementation is used for different platforms like macOS, Windows, QNX, and X11. ```cmake if(APPLE) set(gfxstream_host_testing_oswindow_support_platform_sources osx/OSXWindow.mm) elseif(WIN32) set(gfxstream_host_testing_oswindow_support_platform_sources windows/WindowsTimer.cpp windows/Windows_system_utils.cpp windows/win32/Win32Window.cpp) elseif(QNX) set(gfxstream_host_testing_oswindow_support_platform_sources qnx/QNXWindow.cpp) else() set(gfxstream_host_testing_oswindow_support_platform_sources x11/X11Window.cpp) endif() ``` -------------------------------- ### Platform-Specific Linking for Windows Source: https://github.com/google/gfxstream/blob/main/host/CMakeLists.txt Links the D3d9.lib library when building on Windows. ```cmake if (WIN32) target_link_libraries(gfxstream_backend_static PRIVATE D3d9.lib) endif() ``` -------------------------------- ### Set Include Directories for Host Library Source: https://github.com/google/gfxstream/blob/main/host/library/CMakeLists.txt Configures the public include directories for the GFXStream host library. This ensures that header files are accessible during compilation. ```cmake target_include_directories( gfxstream_host_library PUBLIC include) ``` -------------------------------- ### Configure QNX EGL Headers Source: https://github.com/google/gfxstream/blob/main/third_party/CMakeLists.txt Defines an interface library for EGL headers on QNX systems, including the necessary include directories. ```cmake if (QNX) # QNX SDP provides EGL headers add_library(gfxstream_egl_headers INTERFACE) target_include_directories(gfxstream_egl_headers INTERFACE ${QNX_TARGET}/usr/include) endif() ``` -------------------------------- ### Add X11 Testing Support Library (Linux) Source: https://github.com/google/gfxstream/blob/main/host/testlibs/support/CMakeLists.txt Defines a library for X11-specific testing support on Linux. This library depends on common base components and OpenGL headers. ```cmake add_library( x11_testing_support X11TestingSupport.cpp ) target_link_libraries( x11_testing_support PUBLIC gfxstream_common_base gfxstream_opengl_headers ) target_include_directories( x11_testing_support PUBLIC ${GFXSTREAM_REPO_ROOT}/host/decoder_common/include ) ``` -------------------------------- ### Add gfxstream_stb Library Source: https://github.com/google/gfxstream/blob/main/third_party/stb/CMakeLists.txt This snippet adds the gfxstream_stb library, including stb_image and stb_image_write source files, and sets up public include directories. It is conditional on the TARGET gfxstream_stb not existing. ```cmake if (NOT TARGET gfxstream_stb) add_library(gfxstream_stb src/stb_image.cpp src/stb_image_write.cpp) target_include_directories(gfxstream_stb PUBLIC include) endif() ``` -------------------------------- ### Configure Graphics Detector Build Source: https://github.com/google/gfxstream/blob/main/common/detector/CMakeLists.txt Builds the graphics detector library and executable when BUILD_GRAPHICS_DETECTOR is enabled. Requires Protobuf and Threads packages. ```cmake if(BUILD_GRAPHICS_DETECTOR) find_package(Protobuf REQUIRED) find_package(Threads REQUIRED) protobuf_generate_cpp( LIBGFXSTREAM_GRAPHICS_DETECTOR_SRCS LIBGFXSTREAM_GRAPHICS_DETECTOR_HDRS GraphicsDetector.proto ) add_library( libgfxstream_graphics_detector_proto STATIC ${LIBGFXSTREAM_GRAPHICS_DETECTOR_SRCS} ) target_link_libraries( libgfxstream_graphics_detector_proto PUBLIC libprotobuf.a ) target_include_directories( libgfxstream_graphics_detector_proto PUBLIC $ ) set_property( TARGET libgfxstream_graphics_detector_proto PROPERTY CXX_STANDARD 17 ) add_executable( gfxstream_graphics_detector DetectGraphics.cpp Egl.cpp Gles.cpp Image.cpp Lib.cpp GraphicsDetector.cpp GraphicsDetectorGl.cpp GraphicsDetectorVk.cpp GraphicsDetectorVkExternalMemoryHost.cpp GraphicsDetectorVkPrecisionQualifiersOnYuvSamplers.cpp Subprocess.cpp Vulkan.cpp ) target_include_directories( gfxstream_graphics_detector PRIVATE . ) target_link_libraries( gfxstream_graphics_detector PRIVATE libgfxstream_graphics_detector_proto gfxstream_vulkan_headers Threads::Threads ${CMAKE_DL_LIBS} ) set_property( TARGET gfxstream_graphics_detector PROPERTY CXX_STANDARD 17 ) endif() ``` -------------------------------- ### Define GFXStream Host Snapshot Header Library Source: https://github.com/google/gfxstream/blob/main/host/snapshot/CMakeLists.txt Defines the gfxstream_host_snapshot.headers library as an interface target. This is typically used for header-only libraries. ```cmake add_library( gfxstream_host_snapshot.headers INTERFACE) ``` -------------------------------- ### Configure gfxstream_host_address_space Library Source: https://github.com/google/gfxstream/blob/main/host/address_space/CMakeLists.txt This CMake code defines and configures the 'gfxstream_host_address_space' library. It includes header-only targets and links against common GFXStream libraries. Use this configuration to build the host-side address space management components. ```cmake if (NOT TARGET gfxstream_host_address_space) add_library( gfxstream_host_address_space.headers INTERFACE) target_include_directories( gfxstream_host_address_space.headers INTERFACE include) target_link_libraries( gfxstream_host_address_space.headers INTERFACE gfxstream_backend_headers) add_library( gfxstream_host_address_space address_space_device.cpp address_space_graphics.cpp ring_buffer.cpp sub_allocator.cpp) target_link_libraries( gfxstream_host_address_space PUBLIC gfxstream_common_base gfxstream_host_address_space.headers gfxstream_common_logging) endif() ``` -------------------------------- ### Dependency Graph Visualization Source: https://github.com/google/gfxstream/blob/main/docs/snapshot.md Represents the dependency graph of Vulkan objects and operations after a specific point in time (Time8). This DOT language output can be used to visualize the relationships between commands and resources. ```dot digraph { "image1" [shape=circle]; "memory1" [shape=circle]; "Helper vkBindImageMemory (Time3)" [shape=circle]; "commandpool1" [shape=circle]; "commandbuffer1" [shape=circle]; "vkCreateImage (Time1)" [shape=box]; "vkAllocateMemory (Time2)" [shape=box]; "vkBindImageMemory (Time3)" [shape=box]; "vkCreateCommandPool (Time4)" [shape=box]; "vkAllocateCommandBuffers (Time5)" [shape=box]; "vkBeginCommandBuffer (Time6)" [shape=box]; "vkCmdCopyBufferToImage (Time7)" [shape=box]; "vkEndCommandBuffer (Time8)" [shape=box]; "vkCreateImage (Time1)" -> "image1"; "vkAllocateMemory (Time2)" -> "memory1"; "vkBindImageMemory (Time3)" -> "Helper vkBindImageMemory (Time3)"; "image1" -> "Helper vkBindImageMemory (Time3)"; "memory1" -> "Helper vkBindImageMemory (Time3)"; "vkCreateCommandPool (Time4)" -> "commandpool1"; "vkAllocateCommandBuffers (Time5)" -> "commandbuffer1"; "commandpool1" -> "commandbuffer1"; "vkCmdCopyBufferToImage (Time7)" -> "image1"; } ``` -------------------------------- ### AddressSanitizer (ASan) Configuration for Windows Source: https://github.com/google/gfxstream/blob/main/CMakeLists.txt Configures AddressSanitizer for Windows builds, including replacing debug runtime library flags and linking ASan libraries. Requires ASAN_LIB_DIR to be set. ```cmake if (WIN32) if (BUILD_ASAN_WIN32) set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address") # ASAN does not work with flag /MDd, replace it with /MD string(REPLACE "/MDd" "/MD" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}") set(CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG}) # ASAN linker # User needs to use -D ASAN_LIB_DIR:STRING=/path/to/asan_libs to add library directory if (NOT DEFINED ASAN_LIB_DIR) message(FATAL_ERROR "Please input ASAN library path with -D ASAN_LIB_DIR:STRING=/path/to/asan_lib_dir") endif() link_libraries(clang_rt.asan_dynamic-x86_64.lib clang_rt.asan_dynamic_runtime_thunk-x86_64.lib) message("Linking ASAN libraries from: ${ASAN_LIB_DIR}") link_directories(${ASAN_LIB_DIR}) endif() endif() ``` -------------------------------- ### Adding Sources to the Compatibility Library Source: https://github.com/google/gfxstream/blob/main/common/base/windows/CMakeLists.txt Specifies the source files to be compiled into the gfxstream_common_base_windows_compat library for MSVC builds. ```cmake target_sources( gfxstream_common_base_windows_compat PRIVATE src/files.cpp src/msvc-posix.c src/time.cpp) ``` -------------------------------- ### Platform-Specific Source Files for Gfxstream Host Decoder Source: https://github.com/google/gfxstream/blob/main/host/decoder_common/CMakeLists.txt Conditionally sets platform-specific source files for the gfxstream_host_decoder_common library. Includes X11Support.cpp only on non-Windows, non-QNX, and non-Apple platforms. ```cmake if (APPLE) set(gfxstream_host_decoder_common-platform-sources) elseif (WIN32) set(gfxstream_host_decoder_common-platform-sources) elseif (QNX) set(gfxstream_host_decoder_common-platform-sources) else() set(gfxstream_host_decoder_common-platform-sources X11Support.cpp) endif() ``` -------------------------------- ### Regenerate Vulkan code Source: https://github.com/google/gfxstream/blob/main/README.md Execute this script to re-generate both guest and Vulkan code for Gfxstream. ```bash scripts/generate-gfxstream-vulkan.sh ``` -------------------------------- ### Linking Libraries for OSWindow Support Source: https://github.com/google/gfxstream/blob/main/host/testlibs/oswindow/CMakeLists.txt Links common and OpenGL headers to the OSWindow support library. Additionally, it links platform-specific libraries like X11 for Linux or AppKit/QuartzCore for macOS. ```cmake target_link_libraries( gfxstream_host_testing_oswindow_support PUBLIC gfxstream_common_base gfxstream_opengl_headers ) if(LINUX) target_link_libraries( gfxstream_host_testing_oswindow_support PRIVATE X11 ) elseif(APPLE) target_link_libraries( gfxstream_host_testing_oswindow_support PRIVATE "-framework AppKit" "-framework QuartzCore") endif() ``` -------------------------------- ### Include SetSubdirectorProperties CMake Script Source: https://github.com/google/gfxstream/blob/main/CMakeLists.txt Includes a CMake script to set subdirectory properties. ```cmake include(toolchain/cmake/SetSubdirectorProperties.cmake) ``` -------------------------------- ### Specify Include Directories for X11 Headers Source: https://github.com/google/gfxstream/blob/main/third_party/x11/CMakeLists.txt Sets the include directories for the gfxstream_x11_headers CMake target. This ensures that header files are discoverable during the build process. ```cmake target_include_directories( gfxstream_x11_headers INTERFACE include) ``` -------------------------------- ### Define Gfxstream ETC Library Targets Source: https://github.com/google/gfxstream/blob/main/common/etc/CMakeLists.txt Configures the interface headers and static library targets for the Gfxstream ETC component. ```cmake add_library( gfxstream_etc_headers INTERFACE) target_include_directories( gfxstream_etc_headers INTERFACE include) add_library( gfxstream_etc STATIC etc.cpp) target_link_libraries( gfxstream_etc PUBLIC gfxstream_etc_headers) ``` -------------------------------- ### Set Include Directories for XCB Headers Library Source: https://github.com/google/gfxstream/blob/main/third_party/xcb/CMakeLists.txt Specifies the interface include directories for the gfxstream_xcb_headers library. This ensures that header files in the 'include' directory are accessible when this library is linked. ```cmake target_include_directories( gfxstream_xcb_headers INTERFACE include) ``` -------------------------------- ### Linker Options for Linux Shared Library Source: https://github.com/google/gfxstream/blob/main/host/CMakeLists.txt Adds linker options to embed a build-id for crashpad compatibility on Linux. ```cmake if (LINUX) # Make sure we embed an build-id that can be used by crashpad. target_link_options(gfxstream_backend PRIVATE "LINKER:--build-id=sha1") endif() ``` -------------------------------- ### Compiler Options for Static Backend Source: https://github.com/google/gfxstream/blob/main/host/CMakeLists.txt Sets private compile options for the static GFXStream backend, including warning flags and a specific macro definition. ```cmake target_compile_options( gfxstream_backend_static PRIVATE -Wall -Wextra # TODO: renable # -Werror -Wno-missing-field-initializers -Wno-unused-parameter -Wno-unused-private-field -Wno-return-type-c-linkage -Wno-extern-c-compat -DGFXSTREAM_ENABLE_HOST_GLES=1 ) ``` -------------------------------- ### Link Libraries for Static Backend Source: https://github.com/google/gfxstream/blob/main/host/CMakeLists.txt Specifies the public libraries to link against the static GFXStream backend library. This includes common libraries, headers, and dispatch libraries. ```cmake target_link_libraries( gfxstream_backend_static PUBLIC ${GFXSTREAM_HOST_COMMON_LIB} gfxstream_backend.headers gfxstream_common_base gfxstream_common_logging gfxstream_drm_headers gfxstream_features gfxstream_glm_headers gfxstream_host_address_space gfxstream_host_common gfxstream_host_decoder_common gfxstream_host_iostream gfxstream_host_library gfxstream_host_renderdoc gfxstream_host_snapshot.headers gfxstream_host_tracing gfxstream_opengl_headers gfxstream_openglesdispatch gfxstream-gl-server gfxstream-vulkan-server gfxstream_xcb_headers GLES_CM_translator_static renderControl_dec ) ``` -------------------------------- ### DependencyGraph after Image Destruction Source: https://github.com/google/gfxstream/blob/main/docs/snapshot.md Illustrates the DependencyGraph state after a vkDestroyImage call, showing the removal of the image node and its associated API call node. ```dot digraph { "instance1" [shape=circle]; "physicaldevice1" [shape=circle]; "device1" [shape=circle]; "memory1" [shape=circle]; "vkCreateInstance (Time1)" [shape=box]; "vkEnumeratePhysicalDevices (Time2)" [shape=box]; "vkCreateDevice (Time3)" [shape=box]; "vkCreateImage (Time4)" [shape=box]; "vkAllocateMemory (Time5)" [shape=box]; "vkBindImageMemory (Time6)" [shape=box]; "vkCreateInstance (Time1)" -> "instance1"; "vkEnumeratePhysicalDevices (Time2)" -> "physicaldevice1"; "instance1" -> "physicaldevice1"; "vkCreateDevice (Time3)" -> "device1"; "physicaldevice1" -> "device1"; "vkAllocateMemory (Time5)" -> "memory1"; "device1" -> "memory1"; "vkBindImageMemory (Time6)"; } ``` -------------------------------- ### Set Private Include Directories for emulated_textures Source: https://github.com/google/gfxstream/blob/main/host/vulkan/emulated_textures/CMakeLists.txt Specifies private include directories for the 'emulated_textures' library. These directories are only accessible during the compilation of this library. ```cmake target_include_directories( emulated_textures PRIVATE ${GFXSTREAM_REPO_ROOT} ${GFXSTREAM_REPO_ROOT}/host ${GFXSTREAM_REPO_ROOT}/host/include ${GFXSTREAM_REPO_ROOT}/host/vulkan ${GFXSTREAM_REPO_ROOT}/host/vulkan/cereal/common) ``` -------------------------------- ### Conditional ISA Selection (Universal Build) Source: https://github.com/google/gfxstream/blob/main/third_party/astc-encoder/Source/UnitTest/CMakeLists.txt Sets the ISA_SIMD variable based on the presence of specific instruction set extensions like AVX2, SSE4.1, or SSE2 when UNIVERSAL_BUILD is enabled. Includes cmake_core.cmake. ```cmake if(${UNIVERSAL_BUILD}) if(${ISA_AVX2}) set(ISA_SIMD "avx2") elseif(${ISA_SSE41}) set(ISA_SIMD "sse4.1") elseif(${ISA_SSE2}) set(ISA_SIMD "sse2") endif() include(cmake_core.cmake) else() set(ARTIFACTS native none neon avx2 sse4.1 sse2) set(CONFIGS ${ISA_NATIVE} ${ISA_NONE} ${ISA_NEON} ${ISA_AVX2} ${ISA_SSE41} ${ISA_SSE2}) list(LENGTH ARTIFACTS ARTIFACTS_LEN) math(EXPR ARTIFACTS_LEN "${ARTIFACTS_LEN} - 1") foreach(INDEX RANGE ${ARTIFACTS_LEN}) list(GET ARTIFACTS ${INDEX} ARTIFACT) list(GET CONFIGS ${INDEX} CONFIG) if(${CONFIG}) set(ISA_SIMD ${ARTIFACT}) include(cmake_core.cmake) endif() endforeach() endif() ```