feat(cmake): use symlink/junction for shaders in build dir (#3013)
This commit is contained in:
@@ -2,9 +2,15 @@
|
|||||||
|
|
||||||
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/assets/"
|
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/assets/"
|
||||||
DESTINATION "${SUNSHINE_ASSETS_DIR}")
|
DESTINATION "${SUNSHINE_ASSETS_DIR}")
|
||||||
# copy assets to build directory, for running without install
|
|
||||||
|
# copy assets (excluding shaders) to build directory, for running without install
|
||||||
file(COPY "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/assets/"
|
file(COPY "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/assets/"
|
||||||
DESTINATION "${CMAKE_BINARY_DIR}/assets")
|
DESTINATION "${CMAKE_BINARY_DIR}/assets"
|
||||||
|
PATTERN "shaders" EXCLUDE)
|
||||||
|
# use symbolic link for shaders directory
|
||||||
|
file(CREATE_LINK "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/assets/shaders"
|
||||||
|
"${CMAKE_BINARY_DIR}/assets/shaders" COPY_ON_ERROR SYMBOLIC)
|
||||||
|
|
||||||
if(${SUNSHINE_BUILD_APPIMAGE} OR ${SUNSHINE_BUILD_FLATPAK})
|
if(${SUNSHINE_BUILD_APPIMAGE} OR ${SUNSHINE_BUILD_FLATPAK})
|
||||||
install(FILES "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/misc/60-sunshine.rules"
|
install(FILES "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/misc/60-sunshine.rules"
|
||||||
DESTINATION "${SUNSHINE_ASSETS_DIR}/udev/rules.d")
|
DESTINATION "${SUNSHINE_ASSETS_DIR}/udev/rules.d")
|
||||||
|
|||||||
@@ -39,9 +39,15 @@ install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/windows/misc/gamepad/"
|
|||||||
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/windows/assets/"
|
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/windows/assets/"
|
||||||
DESTINATION "${SUNSHINE_ASSETS_DIR}"
|
DESTINATION "${SUNSHINE_ASSETS_DIR}"
|
||||||
COMPONENT assets)
|
COMPONENT assets)
|
||||||
# copy assets to build directory, for running without install
|
|
||||||
|
# copy assets (excluding shaders) to build directory, for running without install
|
||||||
file(COPY "${SUNSHINE_SOURCE_ASSETS_DIR}/windows/assets/"
|
file(COPY "${SUNSHINE_SOURCE_ASSETS_DIR}/windows/assets/"
|
||||||
DESTINATION "${CMAKE_BINARY_DIR}/assets")
|
DESTINATION "${CMAKE_BINARY_DIR}/assets"
|
||||||
|
PATTERN "shaders" EXCLUDE)
|
||||||
|
# use junction for shaders directory
|
||||||
|
file(TO_NATIVE_PATH "${SUNSHINE_SOURCE_ASSETS_DIR}/windows/assets/shaders" shaders_in_build_src_native)
|
||||||
|
file(TO_NATIVE_PATH "${CMAKE_BINARY_DIR}/assets/shaders" shaders_in_build_dest_native)
|
||||||
|
execute_process(COMMAND cmd.exe /c mklink /J "${shaders_in_build_dest_native}" "${shaders_in_build_src_native}")
|
||||||
|
|
||||||
# set(CPACK_NSIS_MUI_HEADERIMAGE "") # TODO: image should be 150x57 bmp
|
# set(CPACK_NSIS_MUI_HEADERIMAGE "") # TODO: image should be 150x57 bmp
|
||||||
set(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}\\\\sunshine.ico")
|
set(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}\\\\sunshine.ico")
|
||||||
|
|||||||
Reference in New Issue
Block a user