瀏覽代碼

* CMake: added search for ws2_32 library. (tested with MinGW/MSYS)
* Added missing pcre library for MinGW.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14904 54d463be-8e91-2dee-dedb-b68131a5f0ec

flaviojs 14 年之前
父節點
當前提交
d725299ad1
共有 4 個文件被更改,包括 13 次插入9 次删除
  1. 1 1
      3rdparty/msinttypes/CMakeLists.txt
  2. 二進制
      3rdparty/pcre/lib/libpcre.dll.a
  3. 10 8
      CMakeLists.txt
  4. 2 0
      Changelog-Trunk.txt

+ 1 - 1
3rdparty/msinttypes/CMakeLists.txt

@@ -1,5 +1,5 @@
 
-if( WIN32 )
+if( MSVC )
 find_path( MSINTTYPES_INCLUDE_DIRS "inttypes.h"
 	PATHS "${CMAKE_CURRENT_SOURCE_DIR}/include"
 	NO_DEFAULT_PATH )

二進制
3rdparty/pcre/lib/libpcre.dll.a


+ 10 - 8
CMakeLists.txt

@@ -41,10 +41,12 @@ elseif( "${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}" )
 		"Do not use the source directory to build your files, instead delete CMakeCache.txt, create a separate folder and build there.\n"
 		"Example: (build in subdir 'build' and install to source dir)\n"
 		"  rm -f CMakeCache.txt\n"
-		"  mkdir build && cd build\n"
+		"  mkdir build\n"
+		"  cd build\n"
 		"  cmake -G\"Unix Makefiles\" -DINSTALL_TO_SOURCE=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo ..\n"
 		"  make install\n"
-		"  cd .. && rm -rf build\n"
+		"  cd ..\n"
+		"  rm -rf build\n"
 		"To skip this check, set ALLOW_SAME_DIRECTORY to ON (-DALLOW_SAME_DIRECTORY=ON)" )
 endif()
 
@@ -58,9 +60,9 @@ set( GLOBAL_DEFINITIONS ${COMPILE_DEFINITIONS}  CACHE INTERNAL "" )# string (spa
 mark_as_advanced( GLOBAL_LIBRARIES  GLOBAL_INCLUDE_DIRS  GLOBAL_DEFINITIONS )
 if( WIN32 )
 	set_property( CACHE GLOBAL_DEFINITIONS  PROPERTY VALUE "${GLOBAL_DEFINITIONS} -DFD_SETSIZE=4096" )
-	set_property( CACHE GLOBAL_LIBRARIES    PROPERTY VALUE ${GLOBAL_LIBRARIES} "oldnames.lib" "ws2_32.lib" )
 endif()
 if( MSVC )
+	set_property( CACHE GLOBAL_LIBRARIES    PROPERTY VALUE ${GLOBAL_LIBRARIES} "oldnames.lib" "ws2_32.lib" )
 	set_property( CACHE GLOBAL_DEFINITIONS  PROPERTY VALUE "${GLOBAL_DEFINITIONS} -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DDB_MANUAL_CAST_TO_UNION" )
 endif()
 
@@ -158,12 +160,12 @@ endif()
 
 
 #
-# socket/nsl library (Solaris)
+# socket/nsl/ws2_32 library (Solaris/MinGW)
 #
-if( NOT WIN32 )
-message( STATUS "Detecting socket/nsl library (networking)" )
+if( NOT MSVC )
+message( STATUS "Detecting socket/nsl/ws2_32 library (networking)" )
 set( CMAKE_REQUIRED_LIBRARIES ${GLOBAL_LIBRARIES} )
-find_function_library( bind FUNCTION_BIND_LIBRARIES socket )
+find_function_library( bind FUNCTION_BIND_LIBRARIES socket ws2_32 )
 if( FUNCTION_BIND_LIBRARIES )
 	message( STATUS "Adding global library: ${FUNCTION_BIND_LIBRARIES}" )
 	list( APPEND GLOBAL_LIBRARIES ${FUNCTION_BIND_LIBRARIES} )
@@ -174,7 +176,7 @@ if( FUNCTION_GETHOSTBYNAME_LIBRARIES )
 	message( STATUS "Adding global library: ${FUNCTION_GETHOSTBYNAME_LIBRARIES}" )
 	list( APPEND GLOBAL_LIBRARIES ${FUNCTION_GETHOSTBYNAME_LIBRARIES} )
 endif()
-message( STATUS "Detecting socket/nsl library (networking) - done" )
+message( STATUS "Detecting socket/nsl/ws2_32 library (networking) - done" )
 endif()
 
 

+ 2 - 0
Changelog-Trunk.txt

@@ -4,6 +4,8 @@ Date	Added
 	* CMake: set project language to C, added module FindFunctionLibrary, added search for dl library. (tested with debian-wheezy-i386) [FlavioJS]
 	* CMake: added search for math.h, added search for socket/nsl library. (tested with Solaris-201011-x86)
 	* Added missing include to socket.c.
+	* CMake: added search for ws2_32 library. (tested with MinGW/MSYS)
+	* Added missing pcre library for MinGW.
 2011/07/11
 	* Rev. 14901 Added bonus3 bAddClassDropItem, care of Epoque. [L0ne_W0lf]
 2011/07/10