forked from metin2/server
Added build details, the executables no longer write VERSION.TXT
This commit is contained in:
@ -6,9 +6,7 @@ file(GLOB_RECURSE sources
|
||||
src/*.cpp src/*.h
|
||||
)
|
||||
|
||||
|
||||
include_directories(${PROJECT_BINARY_DIR}/src/)
|
||||
|
||||
# Add the src directory to the include path
|
||||
include_directories(src/)
|
||||
|
||||
add_executable(${PROJECT_NAME} ${sources})
|
||||
|
@ -12,6 +12,7 @@
|
||||
#include "Monarch.h"
|
||||
#include "BlockCountry.h"
|
||||
#include "ItemIDRangeManager.h"
|
||||
#include <version.h>
|
||||
#ifdef __AUCTION__
|
||||
#include "AuctionManager.h"
|
||||
#endif
|
||||
@ -48,8 +49,6 @@ int g_iItemPriceListTableCacheFlushSeconds = 540;
|
||||
extern const char * _malloc_options;
|
||||
#endif
|
||||
|
||||
extern void WriteVersion();
|
||||
|
||||
void emergency_sig(int sig)
|
||||
{
|
||||
if (sig == SIGSEGV)
|
||||
@ -63,7 +62,7 @@ void emergency_sig(int sig)
|
||||
|
||||
int main()
|
||||
{
|
||||
WriteVersion();
|
||||
WriteVersion(std::cout);
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
_malloc_options = "A";
|
||||
|
@ -19,5 +19,6 @@
|
||||
|
||||
#include <memory>
|
||||
#include <algorithm>
|
||||
#include <iostream>
|
||||
|
||||
#endif
|
||||
|
@ -1,21 +1,15 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <version.h>
|
||||
|
||||
void WriteVersion()
|
||||
{
|
||||
#ifndef __WIN32__
|
||||
FILE* fp(fopen("VERSION.txt", "w"));
|
||||
void WriteVersion(std::ostream& out) {
|
||||
out << "Metin2 DB Cache version " << __COMMIT_TAG__ << " "
|
||||
<< "(rev. " << __REVISION__ << ", date: " << __COMMIT_DATE__ << ")"
|
||||
<< std::endl;
|
||||
|
||||
if (NULL != fp)
|
||||
{
|
||||
fprintf(fp, "db\n");
|
||||
fclose(fp);
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "cannot open VERSION.txt\n");
|
||||
exit(0);
|
||||
}
|
||||
#endif
|
||||
out << "OS: " << __OS_NAME__ << ", "
|
||||
<< "target arch: " << __CPU_TARGET__ << ", "
|
||||
<< "compiler: " << __COMPILER__
|
||||
<< std::endl;
|
||||
|
||||
out << std::endl;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user