include("${CMAKE_CURRENT_LIST_DIR}/../core/sources.cmake")
idf_component_register(
  SRCS "app.c" "presentation.c" "storage.c" "atari_core.cpp" "atari_runtime.cpp" "atari_stl.cpp" ${STELLA_SOURCES}
  INCLUDE_DIRS "." ${STELLA_INCLUDE_DIRS}
  REQUIRES c)
set_target_properties(${COMPONENT_LIB} PROPERTIES CXX_STANDARD 11 CXX_STANDARD_REQUIRED YES)
target_compile_definitions(${COMPONENT_LIB} PRIVATE ATARI_NATIVE_RUNTIME)
target_compile_options(${COMPONENT_LIB} PRIVATE
  -O3 -fjump-tables -ftree-switch-conversion -fno-strict-aliasing -nostartfiles -nostdlib -fno-builtin
  -fno-unwind-tables -fno-asynchronous-unwind-tables
  "$<$<COMPILE_LANGUAGE:CXX>:-std=gnu++11;-fno-exceptions;-fno-rtti;-fno-threadsafe-statics>")
# These files predate the toolchain. Preserve warnings without turning new
# compiler diagnostics in vendored code into build failures.
set_source_files_properties(${STELLA_SOURCES} PROPERTIES COMPILE_OPTIONS "-Wno-error=all")
