From c36bac706fa4427eaaed2182150f599471d44729 Mon Sep 17 00:00:00 2001 From: "pius.lee" Date: Tue, 11 Oct 2016 16:27:34 +0900 Subject: [PATCH] Add "--version" option for dotnet-launcher Change-Id: I74e371732fd617e753711bcf9f1e9d9ba4c7e6a9 --- NativeLauncher/CMakeLists.txt | 4 ++++ NativeLauncher/src/dotnet/dotnet_launcher.cc | 2 +- NativeLauncher/src/main.cc | 17 ++++++++++++++++- packaging/dotnet-launcher.spec | 2 +- 4 files changed, 22 insertions(+), 3 deletions(-) diff --git a/NativeLauncher/CMakeLists.txt b/NativeLauncher/CMakeLists.txt index 00657be..37db3f2 100644 --- a/NativeLauncher/CMakeLists.txt +++ b/NativeLauncher/CMakeLists.txt @@ -34,6 +34,10 @@ IF(DEFINED RUNTIME_DIR) SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -DRUNTIME_DIR=${RUNTIME_DIR}") ENDIF(DEFINED RUNTIME_DIR) +IF(DEFINED VERSION) + SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -DVERSION=${VERSION}") +ENDIF(DEFINED VERSION) + SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -pthread -std=c++11 -Wl,--no-as-needed -ggdb") SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -Wl,-zdefs" ) #SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden") diff --git a/NativeLauncher/src/dotnet/dotnet_launcher.cc b/NativeLauncher/src/dotnet/dotnet_launcher.cc index 62738a3..d9879ba 100644 --- a/NativeLauncher/src/dotnet/dotnet_launcher.cc +++ b/NativeLauncher/src/dotnet/dotnet_launcher.cc @@ -171,7 +171,7 @@ int CoreRuntime::RunManagedLauncher() "UseLatestBehaviorWhenTFMNotSpecified" }; - _DBG("trusted platform assemblies : %s", propertyValues[0]); + //_DBG("trusted platform assemblies : %s", propertyValues[0]); _DBG("app_path : %s", propertyValues[1]); _DBG("app_ni_path : %s", propertyValues[2]); _DBG("native dll search path : %s", propertyValues[3]); diff --git a/NativeLauncher/src/main.cc b/NativeLauncher/src/main.cc index 41c0362..c9790ce 100644 --- a/NativeLauncher/src/main.cc +++ b/NativeLauncher/src/main.cc @@ -10,6 +10,16 @@ #include #include +#define __XSTR(x) #x +#define __STR(x) __XSTR(x) + +#ifndef VERSION +#define LAUNCHER_VERSION_STR "-Unknown-" +#else +#define LAUNCHER_VERSION_STR __STR(VERSION) +#endif + +static std::string VersionOption("--version"); static std::string StandaloneOption("--standalone"); int main(int argc, char *argv[]) @@ -22,7 +32,12 @@ int main(int argc, char *argv[]) for (i=1; i