Show version and build options on startup

This commit is contained in:
Iwan Timmer 2015-12-27 18:37:04 +01:00
parent 537dbd8215
commit 6a0079f3ae
3 changed files with 38 additions and 0 deletions

View File

@ -46,6 +46,7 @@ SET(GAMESTREAM_INCLUDE_DIR ./libgamestream)
if(CMAKE_BUILD_TYPE MATCHES Debug)
list(APPEND SRC_LIST ./src/video/fake.c)
list(APPEND MOONLIGHT_DEFINITIONS HAVE_FAKE LC_DEBUG)
list(APPEND MOONLIGHT_OPTIONS FAKE DEBUG)
elseif(NOT BROADCOM_FOUND AND NOT FREESCALE_FOUND AND NOT SOFTWARE_FOUND)
message(FATAL_ERROR "No video output available")
endif()
@ -53,16 +54,23 @@ endif()
if (SOFTWARE_FOUND)
list(APPEND SRC_LIST ./src/video/ffmpeg.c ./src/video/sdl.c ./src/audio/sdl.c)
list(APPEND MOONLIGHT_DEFINITIONS HAVE_SDL)
list(APPEND MOONLIGHT_OPTIONS SDL)
if(VDPAU_FOUND)
list(APPEND SRC_LIST ./src/video/ffmpeg_vdpau.c)
list(APPEND MOONLIGHT_DEFINITIONS HAVE_VDPAU)
list(APPEND MOONLIGHT_OPTIONS VDPAU)
endif()
endif()
if (BROADCOM_FOUND OR FREESCALE_FOUND OR CMAKE_BUILD_TYPE MATCHES Debug)
list(APPEND MOONLIGHT_DEFINITIONS HAVE_EMBEDDED)
list(APPEND MOONLIGHT_OPTIONS EMBEDDED)
endif()
configure_file("./src/configuration.h.in" "${PROJECT_BINARY_DIR}/configuration.h")
include_directories("${PROJECT_BINARY_DIR}")
list(APPEND SRC_LIST ./src/audio/alsa.c)
add_subdirectory(libgamestream)
@ -73,12 +81,14 @@ set_property(TARGET moonlight PROPERTY C_STANDARD 99)
if (CEC_FOUND AND CEC_VERSION_COMPATIBLE)
list(APPEND MOONLIGHT_DEFINITIONS HAVE_LIBCEC)
list(APPEND MOONLIGHT_OPTIONS CEC)
target_include_directories(moonlight PRIVATE ./third_party/libcec ${CEC_INCLUDE_DIRS}/libcec)
target_link_libraries(moonlight ${CEC_LIBRARIES})
endif()
if(BROADCOM_FOUND)
list(APPEND MOONLIGHT_DEFINITIONS HAVE_PI)
list(APPEND MOONLIGHT_OPTIONS PI)
aux_source_directory(./third_party/ilclient ILCLIENT_SRC_LIST)
add_library(moonlight-pi SHARED ./src/video/pi.c ${ILCLIENT_SRC_LIST})
target_include_directories(moonlight-pi PRIVATE ./third_party/ilclient ${BROADCOM_INCLUDE_DIRS} ${GAMESTREAM_INCLUDE_DIR} ${MOONLIGHT_COMMON_INCLUDE_DIR})
@ -89,6 +99,7 @@ endif()
if(FREESCALE_FOUND)
list(APPEND MOONLIGHT_DEFINITIONS HAVE_IMX)
list(APPEND MOONLIGHT_OPTIONS IMX)
add_library(moonlight-imx SHARED ./src/video/imx.c)
target_include_directories(moonlight-imx PRIVATE ${FREESCALE_INCLUDE_DIRS} ${GAMESTREAM_INCLUDE_DIR} ${MOONLIGHT_COMMON_INCLUDE_DIR})
target_link_libraries(moonlight-imx gamestream ${FREESCALE_LIBRARIES})

24
src/configuration.h.in Normal file
View File

@ -0,0 +1,24 @@
/*
* This file is part of Moonlight Embedded.
*
* Copyright (C) 2015 Iwan Timmer
*
* Moonlight is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* Moonlight is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Moonlight; if not, see <http://www.gnu.org/licenses/>.
*/
#define VERSION_MAJOR @MOONLIGHT_MAJOR_VERSION@
#define VERSION_MINOR @MOONLIGHT_MINOR_VERSION@
#define VERSION_PATCH @MOONLIGHT_PATCH_VERSION@
#define COMPILE_OPTIONS "@MOONLIGHT_OPTIONS@"

View File

@ -20,6 +20,7 @@
#include "loop.h"
#include "client.h"
#include "connection.h"
#include "configuration.h"
#include "audio.h"
#include "video.h"
#include "discover.h"
@ -159,6 +160,8 @@ static void pair_check(PSERVER_DATA server) {
}
int main(int argc, char* argv[]) {
printf("Moonlight Embedded %d.%d.%d (%s)\n\n", VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH, COMPILE_OPTIONS);
CONFIGURATION config;
config_parse(argc, argv, &config);