From 9191803370c7f049d889ae78e70ab909ecb43e0c Mon Sep 17 00:00:00 2001 From: Zeex Date: Sun, 12 Apr 2015 20:39:15 +0600 Subject: [PATCH] Set version to 3.10 Now it's consistent with the __Pawn constant (0x030A == 3.10). --- appveyor.yml | 2 +- source/compiler/CMakeLists.txt | 37 ++++++++++++++++++---------------- source/compiler/libpawnc.rc | 11 ++++------ source/compiler/sc1.c | 4 +--- source/compiler/svnrev.h.in | 16 --------------- source/compiler/version.h.in | 4 ++++ 6 files changed, 30 insertions(+), 44 deletions(-) delete mode 100644 source/compiler/svnrev.h.in create mode 100644 source/compiler/version.h.in diff --git a/appveyor.yml b/appveyor.yml index cfe49e5..986653b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -11,5 +11,5 @@ build_script: - cmake --build . --config %CONFIGURATION% --target package artifacts: - - path: pawnc-*-win32.zip + - path: pawnc-*-windows.zip name: Binary package diff --git a/source/compiler/CMakeLists.txt b/source/compiler/CMakeLists.txt index fe5c0ec..dea8706 100644 --- a/source/compiler/CMakeLists.txt +++ b/source/compiler/CMakeLists.txt @@ -3,6 +3,19 @@ cmake_minimum_required(VERSION 2.8) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../cmake) +set(VERSION_MAJOR 3) +set(VERSION_MINOR 10) +set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}) +set(VERSION_STR ${VERSION}.samp) +math(EXPR VERSION_INT "${VERSION_MAJOR} << 8 | ${VERSION_MINOR}") + +# Append git commit hash to the version string +include(GetGitRevisionDescription) +git_describe(GIT_COMMIT --always) +if(GIT_COMMIT) + set(VERSION_STR ${VERSION_STR}.${GIT_COMMIT}) +endif() + # check for optional include files include(CheckIncludeFile) check_include_file("unistd.h" HAVE_UNISTD_H) @@ -43,15 +56,7 @@ if(UNIX) link_libraries(pthread) endif() -# Append git commit hash to the version string -include(GetGitRevisionDescription) -git_describe(GIT_COMMIT --always) -if(GIT_COMMIT) - set(GIT_COMMIT_SUFFIX ".${GIT_COMMIT}") -else() - set(GIT_COMMIT_SUFFIX "") -endif() -configure_file(svnrev.h.in svnrev.h) +configure_file(version.h.in version.h) include_directories(${CMAKE_CURRENT_BINARY_DIR}) # The Pawn compiler shared library @@ -143,12 +148,10 @@ if(MSVC) endif() # Generate a binary package with CPack -if(CMAKE_SYSTEM_NAME) - string(TOLOWER "${CMAKE_SYSTEM_NAME}" SYSTEM_NAME_LOWER) - set(SYSTEM_NAME_SUFFIX -${SYSTEM_NAME_LOWER}) -endif() -if(GIT_COMMIT) - set(GIT_COMMIT_SUFFIX -${GIT_COMMIT}) -endif() -set(CPACK_PACKAGE_FILE_NAME pawnc${GIT_COMMIT_SUFFIX}${SYSTEM_NAME_SUFFIX}) +string(TOLOWER ${CMAKE_SYSTEM_NAME} SYSTEM_NAME_LOWER) +set(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR}) +set(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR}) +set(CPACK_PACKAGE_VERSION ${VERSION_STR}) +set(CPACK_PACKAGE_FILE_NAME pawnc-${VERSION_STR}-${SYSTEM_NAME_LOWER}) +set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/../../license.txt) include(CPack) diff --git a/source/compiler/libpawnc.rc b/source/compiler/libpawnc.rc index 277aedd..bfd5c00 100644 --- a/source/compiler/libpawnc.rc +++ b/source/compiler/libpawnc.rc @@ -4,7 +4,7 @@ #else # include #endif -#include "svnrev.h" +#include "version.h" AppIcon ICON "../bin/pawn.ico" @@ -13,10 +13,7 @@ AppIcon ICON "../bin/pawn.ico" * All strings MUST have an explicit \0. See the Windows SDK documentation * for details on version information and the VERSIONINFO structure. */ -#define VERSION 3 -#define REVISION 2 -#define BUILD SVN_REV -#define VERSIONSTR "3.2." SVN_REVSTR "\0" +#define VERSIONSTR VERSION_STR "\0" #if defined STAND_ALONE #define VERSIONNAME "pawncc.exe\0" #define VERSIONDESCRIPTION "Pawn Compiler\0" @@ -30,8 +27,8 @@ AppIcon ICON "../bin/pawn.ico" #define VERSIONCOPYRIGHT "Copyright \251 1998-2006 ITB CompuPhase\0" VS_VERSION_INFO VERSIONINFO -FILEVERSION VERSION, REVISION, BUILD, 0 -PRODUCTVERSION VERSION, REVISION, BUILD, 0 +FILEVERSION VERSION_MAJOR, VERSION_MINOR, 0, 0 +PRODUCTVERSION VERSION_MAJOR, VERSION_MINOR, 0, 0 FILEFLAGSMASK 0x0000003FL FILEFLAGS 0 #if defined(WIN32) diff --git a/source/compiler/sc1.c b/source/compiler/sc1.c index c82c48d..624e6ba 100644 --- a/source/compiler/sc1.c +++ b/source/compiler/sc1.c @@ -70,9 +70,7 @@ #include "lstring.h" #include "sc.h" -#include "svnrev.h" -#define VERSION_STR "3.2." SVN_REVSTR -#define VERSION_INT 0x030A +#include "version.h" static void resetglobals(void); static void initglobals(void); diff --git a/source/compiler/svnrev.h.in b/source/compiler/svnrev.h.in deleted file mode 100644 index 560ca83..0000000 --- a/source/compiler/svnrev.h.in +++ /dev/null @@ -1,16 +0,0 @@ -/* This file was generated by the "svnrev" utility. - * You should not modify it manually, as it may be re-generated. - * - * $Revision: 3664$ - * $Date: 2006-11-08$ - */ - -#ifndef SVNREH_H -#define SVNREV_H - -#define SVN_REV 3664 -#define SVN_REVSTR "3664.samp@GIT_COMMIT_SUFFIX@" -#define SVN_REVDATE "2006-11-08" -#define SVN_REVSTAMP 20061108L - -#endif /* SVNREV_H */ diff --git a/source/compiler/version.h.in b/source/compiler/version.h.in new file mode 100644 index 0000000..1839d09 --- /dev/null +++ b/source/compiler/version.h.in @@ -0,0 +1,4 @@ +#define VERSION_MINOR @VERSION_MINOR@ +#define VERSION_MAJOR @VERSION_MAJOR@ +#define VERSION_STR "@VERSION_STR@" +#define VERSION_INT @VERSION_INT@