mirror of
https://github.com/LizardByte/Sunshine.git
synced 2025-01-29 09:32:39 +00:00
build(cmake): build web-ui target with cmd instead of bash on windows (#2340)
This commit is contained in:
parent
b4739b05c6
commit
9020c2c229
@ -3,6 +3,18 @@
|
|||||||
|
|
||||||
add_executable(sunshine ${SUNSHINE_TARGET_FILES})
|
add_executable(sunshine ${SUNSHINE_TARGET_FILES})
|
||||||
|
|
||||||
|
# Homebrew build fails the vite build if we set these environment variables
|
||||||
|
# this block must be before the platform specific code
|
||||||
|
if(${SUNSHINE_BUILD_HOMEBREW})
|
||||||
|
set(NPM_SOURCE_ASSETS_DIR "")
|
||||||
|
set(NPM_ASSETS_DIR "")
|
||||||
|
set(NPM_BUILD_HOMEBREW "true")
|
||||||
|
else()
|
||||||
|
set(NPM_SOURCE_ASSETS_DIR ${SUNSHINE_SOURCE_ASSETS_DIR})
|
||||||
|
set(NPM_ASSETS_DIR ${CMAKE_BINARY_DIR})
|
||||||
|
set(NPM_BUILD_HOMEBREW "")
|
||||||
|
endif()
|
||||||
|
|
||||||
# platform specific target definitions
|
# platform specific target definitions
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
include(${CMAKE_MODULE_PATH}/targets/windows.cmake)
|
include(${CMAKE_MODULE_PATH}/targets/windows.cmake)
|
||||||
@ -37,23 +49,6 @@ endif()
|
|||||||
|
|
||||||
target_compile_options(sunshine PRIVATE $<$<COMPILE_LANGUAGE:CXX>:${SUNSHINE_COMPILE_OPTIONS}>;$<$<COMPILE_LANGUAGE:CUDA>:${SUNSHINE_COMPILE_OPTIONS_CUDA};-std=c++17>) # cmake-lint: disable=C0301
|
target_compile_options(sunshine PRIVATE $<$<COMPILE_LANGUAGE:CXX>:${SUNSHINE_COMPILE_OPTIONS}>;$<$<COMPILE_LANGUAGE:CUDA>:${SUNSHINE_COMPILE_OPTIONS_CUDA};-std=c++17>) # cmake-lint: disable=C0301
|
||||||
|
|
||||||
# Homebrew build fails the vite build if we set these environment variables
|
|
||||||
if(${SUNSHINE_BUILD_HOMEBREW})
|
|
||||||
set(NPM_SOURCE_ASSETS_DIR "")
|
|
||||||
set(NPM_ASSETS_DIR "")
|
|
||||||
set(NPM_BUILD_HOMEBREW "true")
|
|
||||||
else()
|
|
||||||
set(NPM_SOURCE_ASSETS_DIR ${SUNSHINE_SOURCE_ASSETS_DIR})
|
|
||||||
set(NPM_ASSETS_DIR ${CMAKE_BINARY_DIR})
|
|
||||||
set(NPM_BUILD_HOMEBREW "")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
#WebUI build
|
|
||||||
add_custom_target(web-ui ALL
|
|
||||||
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
|
||||||
COMMENT "Installing NPM Dependencies and Building the Web UI"
|
|
||||||
COMMAND bash -c \"npm install && SUNSHINE_BUILD_HOMEBREW=${NPM_BUILD_HOMEBREW} SUNSHINE_SOURCE_ASSETS_DIR=${NPM_SOURCE_ASSETS_DIR} SUNSHINE_ASSETS_DIR=${NPM_ASSETS_DIR} npm run build\") # cmake-lint: disable=C0301
|
|
||||||
|
|
||||||
# tests
|
# tests
|
||||||
if(BUILD_TESTS)
|
if(BUILD_TESTS)
|
||||||
add_subdirectory(tests)
|
add_subdirectory(tests)
|
||||||
|
@ -1,2 +1,8 @@
|
|||||||
# unix specific target definitions
|
# unix specific target definitions
|
||||||
# put anything here that applies to both linux and macos
|
# put anything here that applies to both linux and macos
|
||||||
|
|
||||||
|
#WebUI build
|
||||||
|
add_custom_target(web-ui ALL
|
||||||
|
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
||||||
|
COMMENT "Installing NPM Dependencies and Building the Web UI"
|
||||||
|
COMMAND bash -c \"npm install && SUNSHINE_BUILD_HOMEBREW=${NPM_BUILD_HOMEBREW} SUNSHINE_SOURCE_ASSETS_DIR=${NPM_SOURCE_ASSETS_DIR} SUNSHINE_ASSETS_DIR=${NPM_ASSETS_DIR} npm run build\") # cmake-lint: disable=C0301
|
||||||
|
@ -4,3 +4,9 @@ set(CMAKE_FIND_LIBRARY_SUFFIXES ".dll")
|
|||||||
find_library(ZLIB ZLIB1)
|
find_library(ZLIB ZLIB1)
|
||||||
list(APPEND SUNSHINE_EXTERNAL_LIBRARIES
|
list(APPEND SUNSHINE_EXTERNAL_LIBRARIES
|
||||||
Wtsapi32.lib)
|
Wtsapi32.lib)
|
||||||
|
|
||||||
|
#WebUI build
|
||||||
|
add_custom_target(web-ui ALL
|
||||||
|
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
||||||
|
COMMENT "Installing NPM Dependencies and Building the Web UI"
|
||||||
|
COMMAND cmd /C "npm install && set \"SUNSHINE_SOURCE_ASSETS_DIR=${NPM_SOURCE_ASSETS_DIR}\" && set \"SUNSHINE_ASSETS_DIR=${NPM_ASSETS_DIR}\" && npm run build") # cmake-lint: disable=C0301
|
||||||
|
Loading…
x
Reference in New Issue
Block a user