Explorar el Código

一些小修改

tanghai hace 14 años
padre
commit
35e653c1fc

+ 2 - 2
Src/CMakeLists.txt

@@ -39,7 +39,7 @@ SET(Boost_USE_MULTITHREADED  ON)
 SET(Boost_USE_STATIC_RUNTIME OFF)
 SET(Boost_USE_STATIC_RUNTIME OFF)
 INCLUDE_DIRECTORIES(${BOOST_INCLUDE_DIRS})
 INCLUDE_DIRECTORIES(${BOOST_INCLUDE_DIRS})
 
 
-set(LinkLibs
+set(ThirdPartyLibs
 	${GLOG_LIBRARY}
 	${GLOG_LIBRARY}
 	${GFLAGS_LIBRARY}
 	${GFLAGS_LIBRARY}
 	${GTEST_LIBRARY}
 	${GTEST_LIBRARY}
@@ -47,6 +47,6 @@ set(LinkLibs
 	${PROTOBUF_LIBRARY}
 	${PROTOBUF_LIBRARY}
 	${Boost_LIBRARIES}
 	${Boost_LIBRARIES}
 	${PYTHON_LIBRARY}
 	${PYTHON_LIBRARY}
-	)
+)
 
 
 ADD_SUBDIRECTORY(Egametang)
 ADD_SUBDIRECTORY(Egametang)

+ 1 - 1
Src/Egametang/Python/CMakeLists.txt

@@ -15,7 +15,7 @@ SET(Excutes
 FOREACH(Excute ${Excutes})
 FOREACH(Excute ${Excutes})
 	TARGET_LINK_LIBRARIES(${Excute}
 	TARGET_LINK_LIBRARIES(${Excute}
 		PythonInterpreter
 		PythonInterpreter
-		${LinkLibs}
+		${ThirdPartyLibs}
 	)
 	)
 	ADD_TEST(${Excute} ${Excute})
 	ADD_TEST(${Excute} ${Excute})
 ENDFOREACH()
 ENDFOREACH()

+ 6 - 6
Src/Egametang/Python/PythonInterpreterTest.cc

@@ -9,10 +9,10 @@ namespace Egametang {
 class PythonInterpreterTest: public testing::Test
 class PythonInterpreterTest: public testing::Test
 {
 {
 protected:
 protected:
-	PythonInterpreter python_interpreter_;
+	PythonInterpreter interpreter_;
 
 
 public:
 public:
-	PythonInterpreterTest(): python_interpreter_()
+	PythonInterpreterTest(): interpreter_()
 	{
 	{
 	}
 	}
 
 
@@ -68,16 +68,16 @@ BOOST_PYTHON_MODULE(PersonTest)
 TEST_F(PythonInterpreterTest, EnterPythonScript)
 TEST_F(PythonInterpreterTest, EnterPythonScript)
 {
 {
 	initPersonTest();
 	initPersonTest();
-	python_interpreter_.ImportPath("../../../Src/Egametang/Python/");
-	python_interpreter_.ImportModule("PythonInterpreterTest");
+	interpreter_.ImportPath("../../../Src/Egametang/Python/");
+	interpreter_.ImportModule("PythonInterpreterTest");
 
 
 	PersonTestPtr person(new PersonTest);
 	PersonTestPtr person(new PersonTest);
-	python_interpreter_.RegisterObjectPtr("person", person);
+	interpreter_.RegisterObjectPtr("person", person);
 
 
 	ASSERT_EQ(0, person->Guid());
 	ASSERT_EQ(0, person->Guid());
 
 
 	// 进到python脚本层设置person的值为2
 	// 进到python脚本层设置person的值为2
-	python_interpreter_.Execute("PythonInterpreterTest.fun(person)");
+	interpreter_.Execute("PythonInterpreterTest.fun(person)");
 
 
 	ASSERT_EQ(2, person->Guid());
 	ASSERT_EQ(2, person->Guid());
 	ASSERT_EQ(std::string("tanghai"), person->Name());
 	ASSERT_EQ(std::string("tanghai"), person->Name());

+ 3 - 3
Src/Egametang/Rpc/CMakeLists.txt

@@ -1,6 +1,6 @@
 PROTOBUF_GENERATE_CPP(proto_srcs proto_hdrs 
 PROTOBUF_GENERATE_CPP(proto_srcs proto_hdrs 
 	Echo.proto
 	Echo.proto
-	)
+)
 
 
 SET(RpcSrc 
 SET(RpcSrc 
 	RpcCommunicator.cc
 	RpcCommunicator.cc
@@ -8,7 +8,7 @@ SET(RpcSrc
 	RpcHandler.cc
 	RpcHandler.cc
 	RpcChannel.cc
 	RpcChannel.cc
 	${proto_srcs}
 	${proto_srcs}
-	)
+)
 
 
 
 
 ADD_LIBRARY(Rpc ${RpcSrc})
 ADD_LIBRARY(Rpc ${RpcSrc})
@@ -25,7 +25,7 @@ FOREACH(Excute ${Excutes})
 	TARGET_LINK_LIBRARIES(${Excute}
 	TARGET_LINK_LIBRARIES(${Excute}
 		Rpc
 		Rpc
 		Thread
 		Thread
-		${LinkLibs}
+		${ThirdPartyLibs}
 	)
 	)
 	ADD_TEST(${Excute} ${Excute})
 	ADD_TEST(${Excute} ${Excute})
 ENDFOREACH()
 ENDFOREACH()

+ 3 - 2
Src/Egametang/Thread/CMakeLists.txt

@@ -1,6 +1,7 @@
 SET(ThreadSrc 
 SET(ThreadSrc 
 	ThreadPool.cc
 	ThreadPool.cc
-	CountBarrier.cc)
+	CountBarrier.cc
+)
 
 
 ADD_LIBRARY(Thread ${ThreadSrc})
 ADD_LIBRARY(Thread ${ThreadSrc})
 
 
@@ -15,7 +16,7 @@ SET(Excutes
 FOREACH(Excute ${Excutes})
 FOREACH(Excute ${Excutes})
 	TARGET_LINK_LIBRARIES(${Excute}
 	TARGET_LINK_LIBRARIES(${Excute}
 		Thread
 		Thread
-		${LinkLibs}
+		${ThirdPartyLibs}
 	)
 	)
 	ADD_TEST(${Excute} ${Excute})
 	ADD_TEST(${Excute} ${Excute})
 ENDFOREACH()
 ENDFOREACH()