add_executable(
	Nostalgia WIN32
		app.cpp
)

# enable LTO
if(NOT WIN32)
	set_property(TARGET Nostalgia PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
endif()

if(COMMAND OBJCOPY_FILE)
	set(LOAD_KEEL_MODS FALSE)
	set_target_properties(Nostalgia
		PROPERTIES
			LINK_FLAGS ${LINKER_FLAGS}
			COMPILER_FLAGS "-mthumb -mthumb-interwork"
	)

	OBJCOPY_FILE(Nostalgia)
	#PADBIN_FILE(Nostalgia)
else()
	set(LOAD_KEEL_MODS TRUE)
endif()

target_compile_definitions(
	Nostalgia PRIVATE
		OLYMPIC_LOAD_KEEL_MODULES=$<BOOL:${LOAD_KEEL_MODS}>
		OLYMPIC_GUI_APP=1
)

target_link_libraries(
	Nostalgia
		NostalgiaKeelModules
		NostalgiaProfile
		OlympicApplib
		OxLogConn
)

install(
	TARGETS
		Nostalgia
	DESTINATION
		bin
)

