Browse Source

Fix the build timestamp to be more translation friendly

tags/v1.3.90
Pierre Ossman 9 years ago
parent
commit
5945d73be7
4 changed files with 11 additions and 36 deletions
  1. 7
    11
      CMakeLists.txt
  2. 0
    1
      vncviewer/CMakeLists.txt
  3. 0
    18
      vncviewer/buildTime.cxx
  4. 4
    6
      vncviewer/vncviewer.cxx

+ 7
- 11
CMakeLists.txt View File

@@ -39,13 +39,13 @@ if(MSVC)
message(FATAL_ERROR "TigerVNC cannot be built with Visual Studio. Please use MinGW")
endif()

set(BUILD "")
execute_process(COMMAND "date" "+%Y%m%d" OUTPUT_VARIABLE BUILD)
set(BUILD_TIMESTAMP "")
execute_process(COMMAND "date" "+%Y-%m-%d %H:%M" OUTPUT_VARIABLE BUILD_TIMESTAMP)

if(NOT BUILD)
set(BUILD "")
if(NOT BUILD_TIMESTAMP)
set(BUILD_TIMESTAMP "")
else()
string(REGEX REPLACE "\n" "" BUILD ${BUILD})
string(REGEX REPLACE "\n" "" BUILD_TIMESTAMP ${BUILD_TIMESTAMP})
endif()

# Default to optimised builds instead of debug ones. Our code has no bugs ;)
@@ -56,12 +56,8 @@ endif()

message(STATUS "CMAKE_BUILD_TYPE = ${CMAKE_BUILD_TYPE}")

if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(BUILD "${BUILD}d")
endif()

message(STATUS "VERSION = ${VERSION}, BUILD = ${BUILD}")
add_definitions(-D__BUILD__="${BUILD}")
message(STATUS "VERSION = ${VERSION}")
add_definitions(-DBUILD_TIMESTAMP="${BUILD_TIMESTAMP}")

# We want to keep our asserts even in release builds so remove NDEBUG
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -UNDEBUG")

+ 0
- 1
vncviewer/CMakeLists.txt View File

@@ -3,7 +3,6 @@ include_directories(${GETTEXT_INCLUDE_DIR})

include_directories(${CMAKE_SOURCE_DIR}/common)
set(VNCVIEWER_SOURCES
buildTime.cxx
menukey.cxx
CConn.cxx
DesktopWindow.cxx

+ 0
- 18
vncviewer/buildTime.cxx View File

@@ -1,18 +0,0 @@
/* Copyright (C) 2005 RealVNC Ltd. All Rights Reserved.
*
* This 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 2 of the License, or
* (at your option) any later version.
*
* This software 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 this software; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
*/
const char* buildTime = "Built on " __DATE__ " at " __TIME__;

+ 4
- 6
vncviewer/vncviewer.cxx View File

@@ -77,14 +77,12 @@ using namespace network;
using namespace rfb;
using namespace std;

static const char _aboutText[] = N_("TigerVNC Viewer %d-bit v%s (%s)\n"
"%s\n"
static const char _aboutText[] = N_("TigerVNC Viewer %d-bit v%s\n"
"Built on: %s\n"
"Copyright (C) 1999-%d TigerVNC Team and many others (see README.txt)\n"
"See http://www.tigervnc.org for information on TigerVNC.");
static char aboutText[1024];

extern const char* buildTime;

char vncServerName[VNCSERVERNAMELEN] = { '\0' };

static bool exitMainloop = false;
@@ -364,8 +362,8 @@ int main(int argc, char** argv)

// Generate the about string now that we get the proper translation
snprintf(aboutText, sizeof(aboutText), _aboutText,
(int)sizeof(size_t)*8, PACKAGE_VERSION, __BUILD__,
buildTime, 2014);
(int)sizeof(size_t)*8, PACKAGE_VERSION,
BUILD_TIMESTAMP, 2014);

rfb::SecurityClient::setDefaults();


Loading…
Cancel
Save