2020-02-15 15:13:53 +00:00
|
|
|
add_library(frontend-common
|
2021-01-07 15:11:19 +00:00
|
|
|
common_host_interface.cpp
|
|
|
|
common_host_interface.h
|
|
|
|
controller_interface.cpp
|
|
|
|
controller_interface.h
|
|
|
|
cubeb_audio_stream.cpp
|
|
|
|
cubeb_audio_stream.h
|
2021-01-30 11:37:49 +00:00
|
|
|
fullscreen_ui.cpp
|
|
|
|
fullscreen_ui.h
|
|
|
|
fullscreen_ui_progress_callback.cpp
|
|
|
|
fullscreen_ui_progress_callback.h
|
2021-04-17 04:23:47 +00:00
|
|
|
game_database.cpp
|
|
|
|
game_database.h
|
2021-01-07 15:11:19 +00:00
|
|
|
game_list.cpp
|
|
|
|
game_list.h
|
2020-11-27 05:42:22 +00:00
|
|
|
game_settings.cpp
|
|
|
|
game_settings.h
|
2021-01-07 15:11:19 +00:00
|
|
|
icon.cpp
|
|
|
|
icon.h
|
2021-06-20 05:41:01 +00:00
|
|
|
inhibit_screensaver.cpp
|
|
|
|
inhibit_screensaver.h
|
2021-01-07 15:11:19 +00:00
|
|
|
ini_settings_interface.cpp
|
|
|
|
ini_settings_interface.h
|
2021-04-03 17:51:08 +00:00
|
|
|
input_overlay_ui.cpp
|
|
|
|
input_overlay_ui.h
|
2021-01-30 11:37:49 +00:00
|
|
|
imgui_fullscreen.cpp
|
2021-04-03 17:51:08 +00:00
|
|
|
imgui_fullscreen.h
|
2021-01-07 15:11:19 +00:00
|
|
|
imgui_impl_opengl3.cpp
|
|
|
|
imgui_impl_opengl3.h
|
|
|
|
imgui_impl_vulkan.cpp
|
|
|
|
imgui_impl_vulkan.h
|
|
|
|
imgui_styles.cpp
|
|
|
|
imgui_styles.h
|
2020-06-29 16:46:57 +00:00
|
|
|
opengl_host_display.cpp
|
|
|
|
opengl_host_display.h
|
2020-12-26 16:22:33 +00:00
|
|
|
postprocessing_chain.cpp
|
|
|
|
postprocessing_chain.h
|
|
|
|
postprocessing_shader.cpp
|
|
|
|
postprocessing_shader.h
|
|
|
|
postprocessing_shadergen.cpp
|
|
|
|
postprocessing_shadergen.h
|
2021-01-07 15:11:19 +00:00
|
|
|
save_state_selector_ui.cpp
|
|
|
|
save_state_selector_ui.h
|
2020-06-18 14:18:19 +00:00
|
|
|
vulkan_host_display.cpp
|
|
|
|
vulkan_host_display.h
|
2020-02-15 15:13:53 +00:00
|
|
|
)
|
|
|
|
|
2021-04-22 05:44:31 +00:00
|
|
|
target_link_libraries(frontend-common PUBLIC core common glad vulkan-loader cubeb imgui simpleini tinyxml2 rapidjson scmversion)
|
2020-04-30 15:01:53 +00:00
|
|
|
|
2020-06-19 17:33:34 +00:00
|
|
|
if(WIN32)
|
|
|
|
target_sources(frontend-common PRIVATE
|
|
|
|
d3d11_host_display.cpp
|
|
|
|
d3d11_host_display.h
|
2021-01-07 15:11:19 +00:00
|
|
|
dinput_controller_interface.cpp
|
|
|
|
dinput_controller_interface.h
|
|
|
|
imgui_impl_dx11.cpp
|
|
|
|
imgui_impl_dx11.h
|
2021-06-30 05:15:39 +00:00
|
|
|
xaudio2_audio_stream.cpp
|
|
|
|
xaudio2_audio_stream.h
|
2021-01-07 15:11:19 +00:00
|
|
|
xinput_controller_interface.cpp
|
|
|
|
xinput_controller_interface.h
|
2020-06-19 17:33:34 +00:00
|
|
|
)
|
|
|
|
target_link_libraries(frontend-common PRIVATE d3d11.lib dxgi.lib)
|
|
|
|
endif()
|
|
|
|
|
2021-06-20 09:21:51 +00:00
|
|
|
if(APPLE)
|
|
|
|
find_library(IOK_LIBRARY IOKit REQUIRED)
|
|
|
|
target_link_libraries(frontend-common PRIVATE "${IOK_LIBRARY}")
|
|
|
|
endif()
|
|
|
|
|
2021-01-07 15:11:19 +00:00
|
|
|
if(SDL2_FOUND)
|
|
|
|
target_sources(frontend-common PRIVATE
|
|
|
|
sdl_audio_stream.cpp
|
|
|
|
sdl_audio_stream.h
|
|
|
|
sdl_controller_interface.cpp
|
|
|
|
sdl_controller_interface.h
|
|
|
|
sdl_initializer.cpp
|
|
|
|
sdl_initializer.h
|
2020-02-28 07:00:12 +00:00
|
|
|
)
|
2021-01-07 15:11:19 +00:00
|
|
|
target_compile_definitions(frontend-common PUBLIC "WITH_SDL2=1")
|
|
|
|
target_include_directories(frontend-common PRIVATE ${SDL2_INCLUDE_DIRS})
|
|
|
|
target_link_libraries(frontend-common PRIVATE ${SDL2_LIBRARIES})
|
2020-05-16 03:10:31 +00:00
|
|
|
|
2021-01-07 15:11:19 +00:00
|
|
|
# Copy bundled SDL2 to output on Windows.
|
2020-05-16 03:10:31 +00:00
|
|
|
if(WIN32)
|
2021-01-07 15:11:19 +00:00
|
|
|
add_custom_command(TARGET frontend-common POST_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${SDL2_DLL_PATH}" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/SDL2.dll")
|
2020-05-16 03:10:31 +00:00
|
|
|
endif()
|
2021-01-07 15:11:19 +00:00
|
|
|
endif()
|
2020-02-28 07:00:12 +00:00
|
|
|
|
2021-02-27 10:53:00 +00:00
|
|
|
if(USE_EVDEV)
|
2021-02-07 11:32:59 +00:00
|
|
|
target_compile_definitions(frontend-common PUBLIC "-DWITH_EVDEV=1")
|
|
|
|
target_include_directories(frontend-common PRIVATE ${LIBEVDEV_INCLUDE_DIRS})
|
|
|
|
target_link_libraries(frontend-common PRIVATE ${LIBEVDEV_LIBRARIES})
|
|
|
|
target_sources(frontend-common PRIVATE
|
|
|
|
evdev_controller_interface.cpp
|
|
|
|
evdev_controller_interface.h
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2021-06-20 05:41:01 +00:00
|
|
|
if(USE_X11)
|
|
|
|
target_compile_definitions(frontend-common PRIVATE "-DUSE_X11=1")
|
|
|
|
target_include_directories(frontend-common PRIVATE "${X11_INCLUDE_DIR}")
|
|
|
|
endif()
|
|
|
|
|
2021-01-07 15:11:19 +00:00
|
|
|
if(ENABLE_DISCORD_PRESENCE)
|
|
|
|
target_compile_definitions(frontend-common PUBLIC -DWITH_DISCORD_PRESENCE=1)
|
|
|
|
target_link_libraries(frontend-common PRIVATE discord-rpc)
|
2020-04-30 15:01:53 +00:00
|
|
|
endif()
|
2020-05-16 03:10:31 +00:00
|
|
|
|
2021-02-26 14:44:53 +00:00
|
|
|
if(ENABLE_CHEEVOS)
|
2021-02-21 08:30:58 +00:00
|
|
|
target_sources(frontend-common PRIVATE
|
|
|
|
http_downloader.cpp
|
|
|
|
http_downloader.h
|
|
|
|
)
|
|
|
|
if(WIN32)
|
|
|
|
target_sources(frontend-common PRIVATE
|
|
|
|
http_downloader_winhttp.cpp
|
|
|
|
http_downloader_winhttp.h
|
|
|
|
)
|
2021-03-13 11:06:31 +00:00
|
|
|
elseif(NOT ANDROID)
|
|
|
|
target_sources(frontend-common PRIVATE
|
|
|
|
http_downloader_curl.cpp
|
|
|
|
http_downloader_curl.h
|
|
|
|
)
|
|
|
|
target_link_libraries(frontend-common PRIVATE
|
|
|
|
CURL::libcurl
|
|
|
|
)
|
2021-02-21 08:30:58 +00:00
|
|
|
endif()
|
2021-02-26 14:44:53 +00:00
|
|
|
|
|
|
|
target_sources(frontend-common PRIVATE
|
|
|
|
cheevos.cpp
|
|
|
|
cheevos.h
|
|
|
|
)
|
|
|
|
target_compile_definitions(frontend-common PUBLIC -DWITH_CHEEVOS=1)
|
|
|
|
target_link_libraries(frontend-common PRIVATE rcheevos rapidjson)
|
2021-02-21 08:30:58 +00:00
|
|
|
endif()
|
|
|
|
|
2021-01-07 15:11:19 +00:00
|
|
|
# Copy the provided data directory to the output directory.
|
|
|
|
add_custom_command(TARGET frontend-common POST_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_SOURCE_DIR}/data" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}"
|
|
|
|
)
|