# Standalone test project. Nothing here links a game executable or changes its dispatch.
# SPDX-License-Identifier: GPL-2.0-or-later
cmake_minimum_required(VERSION 3.20)
project(melee_ppc_leaf_stencils LANGUAGES CXX)
include(CTest)
find_package(Python3 REQUIRED COMPONENTS Interpreter)
set(MELEE_CPU_BASELINE "AVX2" CACHE STRING "Match the host's CPU baseline: AVX2 or SSE2")
if(MELEE_CPU_BASELINE STREQUAL "SSE2")
  set(MELEE_ARCH_FLAG "")
elseif(MELEE_CPU_BASELINE STREQUAL "AVX2")
  set(MELEE_ARCH_FLAG "/arch:AVX2")
else()
  message(FATAL_ERROR "Choose the host's AVX2 or SSE2 baseline")
endif()
set(MELEE_BUILD_PPC_STENCIL_TESTS ON CACHE BOOL "Build the isolated native stencil test")
include("${CMAKE_CURRENT_LIST_DIR}/../../port/runtime/ppc/leaf_translator.cmake")
add_executable(port_guest_heap_trace_test "${CMAKE_CURRENT_LIST_DIR}/../../port/tests/guest_heap_trace_test.cpp")
target_include_directories(port_guest_heap_trace_test PRIVATE "${CMAKE_CURRENT_LIST_DIR}/../../port/runtime/host")
target_compile_features(port_guest_heap_trace_test PRIVATE cxx_std_17)
add_test(NAME port_guest_heap_trace COMMAND port_guest_heap_trace_test)
