Skip to content

Commit 7658886

Browse files
committed
added:apihelp module complie makefile for linux
fix:auto check file sqlite name
1 parent e7f47fc commit 7658886

File tree

6 files changed

+59
-10
lines changed

6 files changed

+59
-10
lines changed

XEngine_Docment/Docment_en.docx

77 Bytes
Binary file not shown.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
CC = g++ -Wall -std=c++17 -fPIC
2+
RELEASE = 0
3+
UNICODE = 0
4+
INCLUDE = -I ./
5+
LOADBIN =
6+
LIB =
7+
LIBEX = -static-libgcc -lrt -ldl -lpthread
8+
LOADSO = -Wl,-rpath=
9+
LIBINCLUDE = APIHelp_Distributed.o pch.o
10+
11+
ifeq ($(RELEASE),1)
12+
FLAGS = -c -O2
13+
DEBUG =
14+
else
15+
FLAGS = -c -lc_p
16+
DEBUG = -g -pg
17+
endif
18+
19+
ifeq ($(UNICODE),1)
20+
UNICODE = -D _UNICODE
21+
else
22+
UNICODE =
23+
endif
24+
25+
26+
all:$(LIBINCLUDE)
27+
$(CC) $(DEBUG) $(LIBINCLUDE) -o libStorageModule_APIHelp.so -shared -fPIC $(LOADBIN) $(LIB) $(LIBEX) $(LOADSO)
28+
29+
APIHelp_Distributed.o:./APIHelp_Distributed/APIHelp_Distributed.cpp
30+
$(CC) $(DEBUG) $(FLAGS) $(UNICODE) $(INCLUDE) ./APIHelp_Distributed/APIHelp_Distributed.cpp
31+
32+
pch.o:./pch.cpp
33+
$(CC) $(DEBUG) $(FLAGS) $(UNICODE) $(INCLUDE) ./pch.cpp
34+
35+
36+
InstallAll:InstallSo
37+
InstallSo:./libStorageModule_APIHelp.so
38+
cp ./libStorageModule_APIHelp.so ../../XEngine_Release/libStorageModule_APIHelp.so
39+
40+
41+
CleanAll:CleanObj CleanMk
42+
CleanObj:
43+
rm *.o
44+
CleanMk:
45+
rm *.so

XEngine_Source/StorageModule_APIHelp/StorageModule_APIHelp.vcxproj

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<UseDebugLibraries>false</UseDebugLibraries>
3838
<PlatformToolset>v142</PlatformToolset>
3939
<WholeProgramOptimization>true</WholeProgramOptimization>
40-
<CharacterSet>Unicode</CharacterSet>
40+
<CharacterSet>MultiByte</CharacterSet>
4141
</PropertyGroup>
4242
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
4343
<ConfigurationType>DynamicLibrary</ConfigurationType>
@@ -77,6 +77,7 @@
7777
</PropertyGroup>
7878
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
7979
<LinkIncremental>false</LinkIncremental>
80+
<IncludePath>$(XEngine_Include);$(IncludePath)</IncludePath>
8081
</PropertyGroup>
8182
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
8283
<LinkIncremental>true</LinkIncremental>
@@ -107,10 +108,12 @@
107108
<FunctionLevelLinking>true</FunctionLevelLinking>
108109
<IntrinsicFunctions>true</IntrinsicFunctions>
109110
<SDLCheck>true</SDLCheck>
110-
<PreprocessorDefinitions>WIN32;NDEBUG;STORAGEMODULEAPIHELP_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
111+
<PreprocessorDefinitions>WIN32;NDEBUG;STORAGEMODULEAPIHELP_EXPORTS;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
111112
<ConformanceMode>true</ConformanceMode>
112113
<PrecompiledHeader>Use</PrecompiledHeader>
113114
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
115+
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
116+
<DisableSpecificWarnings>4819</DisableSpecificWarnings>
114117
</ClCompile>
115118
<Link>
116119
<SubSystem>Windows</SubSystem>

XEngine_Source/XEngine_P2XPComponents/XEngine_P2XPPeer/XEngine_P2XPPeer.vcxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@
123123
<ModuleDefinitionFile>XEngine_P2XPPeer.def</ModuleDefinitionFile>
124124
</Link>
125125
<PostBuildEvent>
126-
<Command>copy "$(SolutionDir)Release\XEngine_P2XPPeer.lib" "../../../XEngine_Release/XEngine_Windows/x86/XEngine_P2xp/XEngine_P2XPPeer.lib"
127-
copy "$(SolutionDir)Release\XEngine_P2XPPeer.dll" "../../../XEngine_Release/XEngine_Windows/x86/XEngine_P2xp/XEngine_P2XPPeer.dll"</Command>
126+
<Command>
127+
</Command>
128128
</PostBuildEvent>
129129
</ItemDefinitionGroup>
130130
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">

XEngine_Source/XEngine_P2XPComponents/XEngine_P2XPProtocol/XEngine_P2XPProtocol.vcxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@
127127
<ModuleDefinitionFile>XEngine_P2XPProtocol.def</ModuleDefinitionFile>
128128
</Link>
129129
<PostBuildEvent>
130-
<Command>copy "$(SolutionDir)Release\XEngine_P2XPProtocol.lib" "../../../XEngine_Release/XEngine_Windows/x86/XEngine_P2xp/XEngine_P2XPProtocol.lib"
131-
copy "$(SolutionDir)Release\XEngine_P2XPProtocol.dll" "../../../XEngine_Release/XEngine_Windows/x86/XEngine_P2xp/XEngine_P2XPProtocol.dll"</Command>
130+
<Command>
131+
</Command>
132132
</PostBuildEvent>
133133
</ItemDefinitionGroup>
134134
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">

XEngine_Source/XEngine_StorageComponents/XStorage_SQLPacket/XStorageSQL_File/XStorageSQL_File.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -799,20 +799,20 @@ BOOL CXStorageSQL_File::XStorageSQL_File_TimeDel()
799799
for (DWORD64 i = 0; i < dwLine; i++)
800800
{
801801
TCHAR** pptszResult = DataBase_MySQL_GetResult(xhDBSQL, xhTableResult);
802-
if (NULL == pptszResult[0])
802+
if (NULL == pptszResult[i])
803803
{
804804
continue;
805805
}
806806
int nTimeMonth = 0;
807807
//只有在处理正确的情况下才进行删除操作
808-
if (XStorageSQL_File_TimeMonth(pptszResult[0], &nTimeMonth))
808+
if (XStorageSQL_File_TimeMonth(pptszResult[i], &nTimeMonth))
809809
{
810810
if (nTimeMonth > m_nTimeMonth)
811811
{
812812
//删除文件
813813
int nListCount = 0;
814814
XSTORAGECORE_DBFILE **ppSt_ListFile;
815-
XStorageSQL_File_FileQueryForTable(&ppSt_ListFile, &nListCount, pptszResult[0]);
815+
XStorageSQL_File_FileQueryForTable(&ppSt_ListFile, &nListCount, pptszResult[i]);
816816

817817
for (int i = 0; i < nListCount; i++)
818818
{
@@ -834,8 +834,9 @@ BOOL CXStorageSQL_File::XStorageSQL_File_TimeDel()
834834
}
835835
//删除数据库
836836
memset(tszSQLQuery, '\0', sizeof(tszSQLQuery));
837-
_stprintf_s(tszSQLQuery, _T("DROP TABLE `%s`"), pptszResult[0]);
837+
_stprintf_s(tszSQLQuery, _T("DROP TABLE `%s`"), pptszResult[i]);
838838
DataBase_MySQL_Execute(xhDBSQL, tszSQLQuery);
839+
BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_ListFile, nListCount);
839840
}
840841
}
841842
}

0 commit comments

Comments
 (0)