mirror of
https://github.com/LizardByte/Sunshine.git
synced 2025-02-21 00:39:59 +00:00
automatically search for config file in the assets dir
This commit is contained in:
parent
11d25b0203
commit
c0ff2c79e8
@ -163,7 +163,7 @@ else()
|
||||
endif()
|
||||
|
||||
if(NOT SUNSHINE_ROOT)
|
||||
set(SUNSHINE_ROOT ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
set(SUNSHINE_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/assets")
|
||||
endif()
|
||||
|
||||
if(SUNSHINE_STANDALONE)
|
||||
@ -182,7 +182,7 @@ list(APPEND SUNSHINE_EXTERNAL_LIBRARIES
|
||||
${OPENSSL_LIBRARIES}
|
||||
${PLATFORM_LIBRARIES})
|
||||
|
||||
list(APPEND SUNSHINE_DEFINITIONS SUNSHINE_ASSETS_DIR="${SUNSHINE_ROOT}/assets")
|
||||
list(APPEND SUNSHINE_DEFINITIONS SUNSHINE_ASSETS_DIR="${SUNSHINE_ROOT}")
|
||||
add_executable(sunshine ${SUNSHINE_TARGET_FILES})
|
||||
target_link_libraries(sunshine ${SUNSHINE_EXTERNAL_LIBRARIES})
|
||||
target_compile_definitions(sunshine PUBLIC ${SUNSHINE_DEFINITIONS})
|
||||
|
@ -23,8 +23,8 @@ before_build:
|
||||
build_script:
|
||||
- cmd: set OLDPATH=%PATH%
|
||||
- cmd: set PATH=C:\msys64\mingw64\bin
|
||||
- sh: cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE ..
|
||||
- cmd: cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DOPENSSL_ROOT_DIR=C:\OpenSSL-v111-Win64 -DSUNSHINE_STANDALONE=ON -DSUNSHINE_ROOT=. -G "MinGW Makefiles" ..
|
||||
- sh: cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DSUNSHINE_ASSETS_DIR=/etc/sunshine ..
|
||||
- cmd: cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DOPENSSL_ROOT_DIR=C:\OpenSSL-v111-Win64 -DSUNSHINE_STANDALONE=ON -DSUNSHINE_ASSETS_DIR=assets -G "MinGW Makefiles" ..
|
||||
- sh: make -j$(nproc)
|
||||
- cmd: mingw32-make -j2
|
||||
- cmd: set PATH=%OLDPATH%
|
||||
|
@ -63,13 +63,16 @@ void on_signal(int sig, FN &&fn) {
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
const char *config_file = SUNSHINE_ASSETS_DIR "/sunshine.conf";
|
||||
if(argc > 1) {
|
||||
if(!std::filesystem::exists(argv[1])) {
|
||||
std::cout << "Fatal Error: Couldn't find configuration file ["sv << argv[1] << ']' << std::endl;
|
||||
return 7;
|
||||
}
|
||||
config_file = argv[1];
|
||||
}
|
||||
|
||||
config::parse_file(argv[1]);
|
||||
if(!std::filesystem::exists(config_file)) {
|
||||
std::cout << "Warning: Couldn't find configuration file ["sv << config_file << ']' << std::endl;
|
||||
}
|
||||
else {
|
||||
config::parse_file(config_file);
|
||||
}
|
||||
|
||||
sink = boost::make_shared<text_sink>();
|
||||
|
Loading…
x
Reference in New Issue
Block a user