merge
--HG-- branch : trunk
This commit is contained in:
+21
-9
@@ -30,15 +30,27 @@ SET(GENREV_SRC
|
||||
src/tools/genrevision/genrevision.cpp
|
||||
)
|
||||
|
||||
ADD_EXECUTABLE(genrev
|
||||
${GENREV_SRC}
|
||||
)
|
||||
ADD_CUSTOM_TARGET("revision.h" ALL
|
||||
COMMAND "${Trinity_BINARY_DIR}/genrev"
|
||||
${Trinity_SOURCE_DIR}
|
||||
WORKING_DIRECTORY "${Trinity_SOURCE_DIR}/src/shared"
|
||||
DEPENDS genrev
|
||||
)
|
||||
if (DO_DEBUG)
|
||||
ADD_EXECUTABLE(genrev
|
||||
${GENREV_SRC}
|
||||
)
|
||||
ADD_CUSTOM_TARGET("revision.h" ALL
|
||||
COMMAND "${Trinity_BINARY_DIR}/genrev -d"
|
||||
${Trinity_SOURCE_DIR}
|
||||
WORKING_DIRECTORY "${Trinity_SOURCE_DIR}/src/shared"
|
||||
DEPENDS genrev
|
||||
)
|
||||
else (DO_DEBUG)
|
||||
ADD_EXECUTABLE(genrev
|
||||
${GENREV_SRC}
|
||||
)
|
||||
ADD_CUSTOM_TARGET("revision.h" ALL
|
||||
COMMAND "${Trinity_BINARY_DIR}/genrev"
|
||||
${Trinity_SOURCE_DIR}
|
||||
WORKING_DIRECTORY "${Trinity_SOURCE_DIR}/src/shared"
|
||||
DEPENDS genrev
|
||||
)
|
||||
endif (DO_DEBUG)
|
||||
|
||||
|
||||
EXECUTE_PROCESS(
|
||||
|
||||
@@ -38,12 +38,12 @@
|
||||
|
||||
#if PLATFORM == PLATFORM_WINDOWS
|
||||
# ifdef _WIN64
|
||||
# define _FULLVERSION _PACKAGENAME "Rev: " _REVISION " Hash: " _HASH " (Win64," _ENDIAN_STRING ")"
|
||||
# define _FULLVERSION _PACKAGENAME "Rev: " _REVISION " " _BUILD_DIRECTIVE " Hash: " _HASH " (Win64," _ENDIAN_STRING ")"
|
||||
# else
|
||||
# define _FULLVERSION _PACKAGENAME "Rev: " _REVISION " Hash: " _HASH " (Win32," _ENDIAN_STRING ")"
|
||||
# define _FULLVERSION _PACKAGENAME "Rev: " _REVISION " " _BUILD_DIRECTIVE " Hash: " _HASH " (Win32," _ENDIAN_STRING ")"
|
||||
# endif
|
||||
#else
|
||||
# define _FULLVERSION _PACKAGENAME "Rev: " _REVISION " Hash: " _HASH " (Unix," _ENDIAN_STRING ")"
|
||||
# define _FULLVERSION _PACKAGENAME "Rev: " _REVISION " " _BUILD_DIRECTIVE " Hash: " _HASH " (Unix," _ENDIAN_STRING ")"
|
||||
#endif
|
||||
|
||||
#define DEFAULT_PLAYER_LIMIT 100
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
|
||||
#pragma warning(disable:4996)
|
||||
|
||||
std::string build_directive;
|
||||
|
||||
struct RawData
|
||||
{
|
||||
char hash_str[200];
|
||||
@@ -298,6 +300,7 @@ std::string generateHeader(char const* rev_str, char const* date_str, char const
|
||||
std::ostringstream newData;
|
||||
newData << "#ifndef __REVISION_H__" << std::endl;
|
||||
newData << "#define __REVISION_H__" << std::endl;
|
||||
newData << " #define _BUILD_DIRECTIVE \"" << build_directive << "\"" << std::endl;
|
||||
newData << " #define _REVISION \"" << rev_str << "\"" << std::endl;
|
||||
newData << " #define _HASH \"" << hash_str << "\"" << std::endl;
|
||||
newData << " #define _REVISION_DATE \"" << date_str << "\"" << std::endl;
|
||||
@@ -325,6 +328,7 @@ int main(int argc, char **argv)
|
||||
bool hg_prefered = true;
|
||||
bool git_prefered = false;
|
||||
bool svn_prefered = false;
|
||||
bool debug = false;
|
||||
std::string path;
|
||||
|
||||
// Call: tool {options} [path]
|
||||
@@ -333,6 +337,7 @@ int main(int argc, char **argv)
|
||||
// -s use svn prefered
|
||||
// -r use only revision (without repo URL) (default)
|
||||
// -u include repositire URL as commit URL or "rev at URL"
|
||||
// -d compile directive debug
|
||||
for (int k = 1; k <= argc; ++k)
|
||||
{
|
||||
if(!argv[k] || !*argv[k])
|
||||
@@ -369,12 +374,20 @@ int main(int argc, char **argv)
|
||||
case 'u':
|
||||
use_url = true;
|
||||
continue;
|
||||
case 'd':
|
||||
debug = true;
|
||||
continue;
|
||||
default:
|
||||
printf("Unknown option %s",argv[k]);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (debug)
|
||||
build_directive = "Debug";
|
||||
else
|
||||
build_directive = "Release";
|
||||
|
||||
/// new data extraction
|
||||
std::string newData;
|
||||
|
||||
|
||||
@@ -884,7 +884,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Getting Version..."
|
||||
CommandLine="cd $(InputDir)
"$(TargetDir)\..\genrevision__$(PlatformName)_$(ConfigurationName)\genrevision.exe" "..\.."
"
|
||||
CommandLine="cd $(InputDir)
"$(TargetDir)\..\genrevision__$(PlatformName)_$(ConfigurationName)\genrevision.exe" "-d" "..\.."
"
|
||||
AdditionalDependencies="$(SolutionDir)../.hg/branch.cache"
|
||||
Outputs="revision.h"
|
||||
/>
|
||||
@@ -895,7 +895,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Getting Version..."
|
||||
CommandLine="cd $(InputDir)
"$(TargetDir)\..\genrevision__$(PlatformName)_$(ConfigurationName)\genrevision.exe" "..\.."
"
|
||||
CommandLine="cd $(InputDir)
"$(TargetDir)\..\genrevision__$(PlatformName)_$(ConfigurationName)\genrevision.exe" "-d" "..\.."
"
|
||||
AdditionalDependencies="$(SolutionDir)../.hg/branch.cache"
|
||||
Outputs="revision.h"
|
||||
/>
|
||||
|
||||
@@ -883,7 +883,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Getting Version..."
|
||||
CommandLine="cd $(InputDir)
"$(TargetDir)\..\genrevision__$(PlatformName)_$(ConfigurationName)\genrevision.exe" "..\.."
"
|
||||
CommandLine="cd $(InputDir)
"$(TargetDir)\..\genrevision__$(PlatformName)_$(ConfigurationName)\genrevision.exe" "-d" "..\.."
"
|
||||
AdditionalDependencies="$(SolutionDir)../.hg/branch.cache"
|
||||
Outputs="revision.h"
|
||||
/>
|
||||
@@ -894,7 +894,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Getting Version..."
|
||||
CommandLine="cd $(InputDir)
"$(TargetDir)\..\genrevision__$(PlatformName)_$(ConfigurationName)\genrevision.exe" "..\.."
"
|
||||
CommandLine="cd $(InputDir)
"$(TargetDir)\..\genrevision__$(PlatformName)_$(ConfigurationName)\genrevision.exe" "-d" "..\.."
"
|
||||
AdditionalDependencies="$(SolutionDir)../.hg/branch.cache"
|
||||
Outputs="revision.h"
|
||||
/>
|
||||
@@ -916,7 +916,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Getting Version..."
|
||||
CommandLine="cd $(InputDir)
"$(TargetDir)\..\genrevision__$(PlatformName)_$(ConfigurationName)\genrevision.exe" "..\.."
"
|
||||
CommandLine="cd $(InputDir)
"$(TargetDir)\..\genrevision__$(PlatformName)_$(ConfigurationName)\genrevision.exe" "-d" "..\.."
"
|
||||
AdditionalDependencies="$(SolutionDir)../.hg/branch.cache"
|
||||
Outputs="revision.h"
|
||||
/>
|
||||
@@ -927,7 +927,7 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Getting Version..."
|
||||
CommandLine="cd $(InputDir)
"$(TargetDir)\..\genrevision__$(PlatformName)_$(ConfigurationName)\genrevision.exe" "..\.."
"
|
||||
CommandLine="cd $(InputDir)
"$(TargetDir)\..\genrevision__$(PlatformName)_$(ConfigurationName)\genrevision.exe" "-d" "..\.."
"
|
||||
AdditionalDependencies="$(SolutionDir)../.hg/branch.cache"
|
||||
Outputs="revision.h"
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user