<commit_before>cmake_minimum_required(VERSION 3.3)

project(CHIPPU-hachi)

option(SDL2_BACKEND "Build with the SDL2 backend" OFF)
option(NCURSES_BACKEND "Build with the ncurses backend" OFF)

add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-std=c++14>)
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-Wall>)
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-g>)

set(EXEC_NAME chippu-hachi)
set(CHIP8_DIR "CHIP-8/")

set(SRC
	${CHIP8_DIR}VM.cpp
	${CHIP8_DIR}Memory.cpp
	${CHIP8_DIR}Display.cpp
	${CHIP8_DIR}Timer.cpp
)


include(FindPkgConfig)

if(SDL2_BACKEND)
	pkg_search_module(SDL2 REQUIRED sdl2)
	pkg_search_module(SDL2_MIXER REQUIRED SDL2_mixer)

	set(BACKEND_DIR "SDL2/")
	list(APPEND SRC ${BACKEND_DIR}SDL2.cpp)
elseif(NCURSES_BACKEND)
	pkg_search_module(NCURSES REQUIRED ncurses)

	set(BACKEND_DIR "ncurses/")
	list(APPEND SRC ${BACKEND_DIR}Ncurses.cpp)
	list(APPEND SRC ${BACKEND_DIR}Clock.cpp)<commit_msg>[SDL2 backend] copy beep.mp3 to binary directory<commit_after>cmake_minimum_required(VERSION 3.3)

project(CHIPPU-hachi)

option(SDL2_BACKEND "Build with the SDL2 backend" OFF)
option(NCURSES_BACKEND "Build with the ncurses backend" OFF)

add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-std=c++14>)
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-Wall>)
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-g>)

set(EXEC_NAME chippu-hachi)
set(CHIP8_DIR "CHIP-8/")

set(SRC
	${CHIP8_DIR}VM.cpp
	${CHIP8_DIR}Memory.cpp
	${CHIP8_DIR}Display.cpp
	${CHIP8_DIR}Timer.cpp
)


include(FindPkgConfig)

if(SDL2_BACKEND)
	pkg_search_module(SDL2 REQUIRED sdl2)
	pkg_search_module(SDL2_MIXER REQUIRED SDL2_mixer)

	set(BACKEND_DIR "SDL2/")
	list(APPEND SRC ${BACKEND_DIR}SDL2.cpp)
	file(COPY ${BACKEND_DIR}beep.mp3 DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
elseif(NCURSES_BACKEND)
	pkg_search_module(NCURSES REQUIRED ncurses)

	set(BACKEND_DIR "ncurses/")
	list(APPEND SRC ${BACKEND_DIR}Ncurses.cpp)
	list(APPEND SRC ${BACKEND_DIR}Clock.cpp)
{'fraction_non_alphanumeric': 0.1305699481865285, 'fraction_numerical': 0.021243523316062177, 'mean_word_length': 8.655, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '293459', 'n_tokens_mistral': 882, 'n_tokens_neox': 846, 'n_words': 117}