# Disable in-source build.
if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
  message(FATAL_ERROR "In-source build is not allowed. Please specify a build folder.\ne.g. cmake -B build")
endif()
cmake_minimum_required(VERSION 3.21)
project(xmos_cmake_build_example
  VERSION 1.0.0
  LANGUAGES XC
)
set(TARGET_OPTIONS
  -target=XCORE-AI-EXPLORER
)
set(target_name "example")
add_executable(${target_name})
target_sources(${target_name}
  PRIVATE
  src/main.xc
)
target_include_directories(${target_name}
  PRIVATE
  src
)
target_compile_options(${target_name}
  PRIVATE 
  ${TARGET_OPTIONS}
)
target_link_options(${target_name}
  PRIVATE 
  ${TARGET_OPTIONS}
)
target_compile_definitions(${target_name}
  PRIVATE 
  XMOS_STRING_VALUE="XMOS"
)
