add_library(
	NostalgiaCore
		gfx.cpp
		keelmodule.cpp
		typeconv.cpp
)

if(TURBINE_BUILD_TYPE STREQUAL "GBA")
	add_subdirectory(gba)
else()
	add_subdirectory(opengl)
endif()

if(NOT MSVC)
	target_compile_options(NostalgiaCore PUBLIC -Wsign-conversion)
	target_compile_options(NostalgiaCore PRIVATE -Wconversion)
endif()

target_link_libraries(
	NostalgiaCore PUBLIC
		Turbine
)

if(NOSTALGIA_BUILD_STUDIO)
	add_subdirectory(studio)
endif()

install(
	FILES
		color.hpp
		config.hpp
		consts.hpp
		context.hpp
		core.hpp
		gfx.hpp
		initparams.hpp
		ptidxconv.hpp
		tilesheet.hpp
		typeconv.hpp
	DESTINATION
		include/nostalgia/core
)

install(
	TARGETS
		NostalgiaCore
	DESTINATION
		LIBRARY DESTINATION lib
		ARCHIVE DESTINATION lib
)
