2020-02-15 15:13:53 +00:00
|
|
|
add_library(frontend-common
|
2022-07-11 13:03:29 +00:00
|
|
|
common_host.cpp
|
|
|
|
common_host.h
|
2021-01-30 11:37:49 +00:00
|
|
|
fullscreen_ui.cpp
|
|
|
|
fullscreen_ui.h
|
2021-01-07 15:11:19 +00:00
|
|
|
game_list.cpp
|
|
|
|
game_list.h
|
2022-07-08 14:25:16 +00:00
|
|
|
host_settings.cpp
|
2021-01-07 15:11:19 +00:00
|
|
|
icon.cpp
|
|
|
|
icon.h
|
2022-07-11 13:03:29 +00:00
|
|
|
input_manager.cpp
|
|
|
|
input_manager.h
|
|
|
|
input_source.cpp
|
|
|
|
input_source.h
|
|
|
|
imgui_fullscreen.cpp
|
|
|
|
imgui_fullscreen.h
|
|
|
|
imgui_manager.cpp
|
|
|
|
imgui_manager.h
|
|
|
|
imgui_overlays.cpp
|
|
|
|
imgui_overlays.h
|
2022-09-21 12:44:52 +00:00
|
|
|
platform_misc.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
|
2020-02-15 15:13:53 +00:00
|
|
|
)
|
|
|
|
|
2022-08-04 11:34:16 +00:00
|
|
|
target_link_libraries(frontend-common PUBLIC core common imgui tinyxml2 rapidjson scmversion)
|
|
|
|
|
|
|
|
if(ENABLE_CUBEB)
|
|
|
|
target_sources(frontend-common PRIVATE
|
|
|
|
cubeb_audio_stream.cpp
|
|
|
|
cubeb_audio_stream.h
|
|
|
|
)
|
|
|
|
target_link_libraries(frontend-common PRIVATE cubeb)
|
|
|
|
endif()
|
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-07-10 11:37:08 +00:00
|
|
|
d3d12_host_display.cpp
|
|
|
|
d3d12_host_display.h
|
2022-07-11 13:03:29 +00:00
|
|
|
dinput_source.cpp
|
|
|
|
dinput_source.h
|
2021-01-07 15:11:19 +00:00
|
|
|
imgui_impl_dx11.cpp
|
|
|
|
imgui_impl_dx11.h
|
2021-07-10 11:37:08 +00:00
|
|
|
imgui_impl_dx12.cpp
|
|
|
|
imgui_impl_dx12.h
|
2022-07-11 13:03:29 +00:00
|
|
|
win32_raw_input_source.cpp
|
|
|
|
win32_raw_input_source.h
|
2021-06-30 05:15:39 +00:00
|
|
|
xaudio2_audio_stream.cpp
|
|
|
|
xaudio2_audio_stream.h
|
2022-07-11 13:03:29 +00:00
|
|
|
xinput_source.cpp
|
|
|
|
xinput_source.h
|
2020-06-19 17:33:34 +00:00
|
|
|
)
|
|
|
|
target_link_libraries(frontend-common PRIVATE d3d11.lib dxgi.lib)
|
|
|
|
endif()
|
|
|
|
|
2022-07-30 15:06:40 +00:00
|
|
|
if(ENABLE_OPENGL)
|
|
|
|
target_sources(frontend-common PRIVATE
|
|
|
|
opengl_host_display.cpp
|
|
|
|
opengl_host_display.h
|
|
|
|
imgui_impl_opengl3.cpp
|
|
|
|
imgui_impl_opengl3.h
|
|
|
|
)
|
|
|
|
target_link_libraries(frontend-common PRIVATE glad)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(ENABLE_VULKAN)
|
|
|
|
target_sources(frontend-common PRIVATE
|
|
|
|
imgui_impl_vulkan.cpp
|
|
|
|
imgui_impl_vulkan.h
|
|
|
|
vulkan_host_display.cpp
|
|
|
|
vulkan_host_display.h
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2022-09-21 12:44:52 +00:00
|
|
|
if(WIN32)
|
|
|
|
target_sources(frontend-common PRIVATE
|
|
|
|
platform_misc_win32.cpp
|
|
|
|
)
|
|
|
|
target_link_libraries(frontend-common PRIVATE winmm.lib)
|
|
|
|
elseif(APPLE)
|
2021-06-20 09:21:51 +00:00
|
|
|
find_library(IOK_LIBRARY IOKit REQUIRED)
|
|
|
|
target_link_libraries(frontend-common PRIVATE "${IOK_LIBRARY}")
|
2022-09-21 12:44:52 +00:00
|
|
|
target_sources(frontend-common PRIVATE
|
|
|
|
platform_misc_mac.mm
|
|
|
|
)
|
|
|
|
elseif(NOT ANDROID)
|
|
|
|
target_sources(frontend-common PRIVATE
|
|
|
|
platform_misc_unix.cpp
|
|
|
|
)
|
2021-06-20 09:21:51 +00:00
|
|
|
endif()
|
|
|
|
|
2021-01-07 15:11:19 +00:00
|
|
|
if(SDL2_FOUND)
|
|
|
|
target_sources(frontend-common PRIVATE
|
2022-07-11 13:03:29 +00:00
|
|
|
sdl_input_source.cpp
|
|
|
|
sdl_input_source.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
|
2022-08-24 14:54:22 +00:00
|
|
|
evdev_input_source.cpp
|
|
|
|
evdev_input_source.h
|
2021-02-07 11:32:59 +00:00
|
|
|
)
|
|
|
|
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
|
|
|
|
2022-07-11 13:03:29 +00:00
|
|
|
if(ENABLE_CHEEVOS)
|
|
|
|
target_sources(frontend-common PRIVATE
|
|
|
|
achievements.cpp
|
|
|
|
achievements.h
|
|
|
|
)
|
|
|
|
target_compile_definitions(frontend-common PUBLIC -DWITH_CHEEVOS=1)
|
|
|
|
target_link_libraries(frontend-common PRIVATE rcheevos rapidjson)
|
|
|
|
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}"
|
|
|
|
)
|