[Ttssh2-commit] [8562] コマンドプロンプトから msys2 の MinGW で libs/buildall.cmake ができるようにした

scmno****@osdn***** scmno****@osdn*****
2020年 2月 25日 (火) 01:39:11 JST


Revision: 8562
          https://osdn.net/projects/ttssh2/scm/svn/commits/8562
Author:   zmatsuo
Date:     2020-02-25 01:39:10 +0900 (Tue, 25 Feb 2020)
Log Message:
-----------
コマンドプロンプトから msys2 の MinGW で libs/buildall.cmake ができるようにした

- 従来は msys2 の shell から行うことを想定していた
- openssl が linux でうまくビルドできなかったので修正

Modified Paths:
--------------
    trunk/libs/SFMT.cmake
    trunk/libs/buildall.cmake
    trunk/libs/oniguruma.cmake
    trunk/libs/openssl11.cmake
    trunk/libs/zlib.cmake

-------------- next part --------------
Modified: trunk/libs/SFMT.cmake
===================================================================
--- trunk/libs/SFMT.cmake	2020-02-24 16:39:06 UTC (rev 8561)
+++ trunk/libs/SFMT.cmake	2020-02-24 16:39:10 UTC (rev 8562)
@@ -24,7 +24,7 @@
 	  -P SFMT.cmake
 	  )
 	return()
-  elseif("$ENV{MSYSTEM}" MATCHES "MINGW")
+  elseif(("$ENV{MSYSTEM}" MATCHES "MINGW") OR ("${CMAKE_COMMAND}" MATCHES "mingw"))
 	# mingw on msys2
 	if("${CMAKE_BUILD_TYPE}" STREQUAL "")
 	  set(CMAKE_BUILD_TYPE Release)
@@ -68,7 +68,7 @@
 set(SRC_DIR "${CMAKE_SOURCE_DIR}/build/SFMT/src/${SRC_DIR_BASE}")
 set(BUILD_DIR "${CMAKE_SOURCE_DIR}/build/SFMT/build_${TOOLSET}")
 set(INSTALL_DIR "${CMAKE_SOURCE_DIR}/SFMT_${TOOLSET}")
-if(("${CMAKE_GENERATOR}" MATCHES "Win64") OR ("${ARCHITECTURE}" MATCHES "x64") OR ("$ENV{MSYSTEM_CHOST}" STREQUAL "x86_64-w64-mingw32"))
+if(("${CMAKE_GENERATOR}" MATCHES "Win64") OR ("${ARCHITECTURE}" MATCHES "x64") OR ("$ENV{MSYSTEM_CHOST}" STREQUAL "x86_64-w64-mingw32") OR ("${CMAKE_COMMAND}" MATCHES "mingw64"))
   set(BUILD_DIR "${BUILD_DIR}_x64")
   set(INSTALL_DIR "${INSTALL_DIR}_x64")
 endif()

Modified: trunk/libs/buildall.cmake
===================================================================
--- trunk/libs/buildall.cmake	2020-02-24 16:39:06 UTC (rev 8561)
+++ trunk/libs/buildall.cmake	2020-02-24 16:39:10 UTC (rev 8562)
@@ -2,6 +2,7 @@
 # cmake -DCMAKE_GENERATOR="Visual Studio 16 2019" -DARCHITECTURE=x64 -P buildall.cmake
 # cmake -DCMAKE_GENERATOR="Visual Studio 15 2017" -P buildall.cmake
 # cmake -DCMAKE_GENERATOR="Visual Studio 15 2017 Win64" -P buildall.cmake
+# .\cmake-3.11.4-win32-x86\bin\cmake.exe -DCMAKE_GENERATOR="Visual Studio 8 2005" -P buildall.cmake
 # cmake -DCMAKE_GENERATOR="Unix Makefiles" -P buildall.cmake
 
 if("${CMAKE_GENERATOR}" STREQUAL "")

Modified: trunk/libs/oniguruma.cmake
===================================================================
--- trunk/libs/oniguruma.cmake	2020-02-24 16:39:06 UTC (rev 8561)
+++ trunk/libs/oniguruma.cmake	2020-02-24 16:39:10 UTC (rev 8562)
@@ -25,7 +25,7 @@
 	  -P oniguruma.cmake
 	  )
 	return()
-  elseif("$ENV{MSYSTEM}" MATCHES "MINGW")
+  elseif(("$ENV{MSYSTEM}" MATCHES "MINGW") OR ("${CMAKE_COMMAND}" MATCHES "mingw"))
 	# mingw on msys2
 	if("${CMAKE_BUILD_TYPE}" STREQUAL "")
 	  set(CMAKE_BUILD_TYPE Release)
@@ -68,7 +68,7 @@
 set(SRC_DIR "${CMAKE_SOURCE_DIR}/build/oniguruma/src/${SRC_DIR_BASE}")
 set(BUILD_DIR "${CMAKE_SOURCE_DIR}/build/oniguruma/build_${TOOLSET}")
 set(INSTALL_DIR "${CMAKE_SOURCE_DIR}/oniguruma_${TOOLSET}")
-if(("${CMAKE_GENERATOR}" MATCHES "Win64") OR ("${ARCHITECTURE}" MATCHES "x64") OR ("$ENV{MSYSTEM_CHOST}" STREQUAL "x86_64-w64-mingw32"))
+if(("${CMAKE_GENERATOR}" MATCHES "Win64") OR ("${ARCHITECTURE}" MATCHES "x64") OR ("$ENV{MSYSTEM_CHOST}" STREQUAL "x86_64-w64-mingw32") OR ("${CMAKE_COMMAND}" MATCHES "mingw64"))
   set(BUILD_DIR "${BUILD_DIR}_x64")
   set(INSTALL_DIR "${INSTALL_DIR}_x64")
 endif()

Modified: trunk/libs/openssl11.cmake
===================================================================
--- trunk/libs/openssl11.cmake	2020-02-24 16:39:06 UTC (rev 8561)
+++ trunk/libs/openssl11.cmake	2020-02-24 16:39:10 UTC (rev 8562)
@@ -67,7 +67,7 @@
 
 set(EXTRACT_DIR "${CMAKE_SOURCE_DIR}/build/openssl11/src_${TOOLSET}")
 set(INSTALL_DIR "${CMAKE_SOURCE_DIR}/openssl11_${TOOLSET}")
-if(("${CMAKE_GENERATOR}" MATCHES "Win64") OR ("$ENV{MSYSTEM_CHOST}" STREQUAL "x86_64-w64-mingw32") OR ("${ARCHITECTURE}" MATCHES "x64"))
+if(("${CMAKE_GENERATOR}" MATCHES "Win64") OR ("$ENV{MSYSTEM_CHOST}" STREQUAL "x86_64-w64-mingw32") OR ("${ARCHITECTURE}" MATCHES "x64") OR ("${CMAKE_COMMAND}" MATCHES "mingw64"))
   set(EXTRACT_DIR "${EXTRACT_DIR}_x64")
   set(INSTALL_DIR "${INSTALL_DIR}_x64")
 endif()
@@ -305,7 +305,7 @@
       HINTS c:/cygwin/usr/bin
       HINTS c:/cygwin64/usr/bin
       )
-  elseif(("${UNAME_S}" STREQUAL "MINGW32") OR ("${UNAME_S}" STREQUAL "MINGW64"))
+  elseif(("${UNAME_S}" STREQUAL "MINGW32") OR ("${UNAME_S}" STREQUAL "MINGW64") OR ("${CMAKE_COMMAND}" MATCHES "mingw"))
     find_program(
       MAKE make
       )
@@ -317,23 +317,21 @@
     message(FATAL_ERROR "unsported")
   endif()
   set(ENV{PATH} "/usr/bin;/bin")
-  if("${UNAME_S}" STREQUAL "MINGW32")
+  if(("${UNAME_S}" STREQUAL "MINGW32") OR ("${CMAKE_COMMAND}" MATCHES "mingw32"))
     set(CMAKE_C_COMPILER "cc")
     set(PATH "/mingw32/bin:/usr/local/bin:/usr/bin:/bin")
-  elseif("${UNAME_S}" STREQUAL "MINGW64")
+    set(CONFIG_NAME "mingw")
+  elseif(("${UNAME_S}" STREQUAL "MINGW64") OR ("${CMAKE_COMMAND}" MATCHES "mingw64"))
     set(CMAKE_C_COMPILER "cc")
     set(PATH "/mingw64/bin:/usr/local/bin:/usr/bin:/bin")
+    set(CONFIG_NAME "mingw64")
   else()
     include(${CMAKE_SOURCE_DIR}/../mingw.toolchain.cmake)
-    set(ENV{PREFIX} i686-w64-mingw32)
     set(ENV{CC} ${CMAKE_C_COMPILER})
     set(ENV{AR} "i686-w64-mingw32-ar")
     set(ENV{RANLIB} "i686-w64-mingw32-ranlib")
+    set(ENV{RC} "i686-w64-mingw32-windres")
     set(PATH "/usr/bin:/bin")
-  endif()
-  if("${UNAME_S}" STREQUAL "MINGW64")
-    set(CONFIG_NAME "mingw64")
-  else()
     set(CONFIG_NAME "mingw")
   endif()
   execute_process(

Modified: trunk/libs/zlib.cmake
===================================================================
--- trunk/libs/zlib.cmake	2020-02-24 16:39:06 UTC (rev 8561)
+++ trunk/libs/zlib.cmake	2020-02-24 16:39:10 UTC (rev 8562)
@@ -23,7 +23,7 @@
 	  -P zlib.cmake
 	  )
 	return()
-  elseif("$ENV{MSYSTEM}" MATCHES "MINGW")
+  elseif(("$ENV{MSYSTEM}" MATCHES "MINGW") OR ("${CMAKE_COMMAND}" MATCHES "mingw"))
 	# mingw on msys2
 	if("${CMAKE_BUILD_TYPE}" STREQUAL "")
 	  set(CMAKE_BUILD_TYPE Release)
@@ -66,7 +66,7 @@
 set(SRC_DIR "${CMAKE_SOURCE_DIR}/build/zlib/src/${SRC_DIR_BASE}")
 set(BUILD_DIR "${CMAKE_SOURCE_DIR}/build/zlib/build_${TOOLSET}")
 set(INSTALL_DIR "${CMAKE_SOURCE_DIR}/zlib_${TOOLSET}")
-if(("${CMAKE_GENERATOR}" MATCHES "Win64") OR ("${ARCHITECTURE}" MATCHES "x64") OR ("$ENV{MSYSTEM_CHOST}" STREQUAL "x86_64-w64-mingw32"))
+if(("${CMAKE_GENERATOR}" MATCHES "Win64") OR ("${ARCHITECTURE}" MATCHES "x64") OR ("$ENV{MSYSTEM_CHOST}" STREQUAL "x86_64-w64-mingw32") OR ("${CMAKE_COMMAND}" MATCHES "mingw64"))
   set(BUILD_DIR "${BUILD_DIR}_x64")
   set(INSTALL_DIR "${INSTALL_DIR}_x64")
 endif()


Ttssh2-commit メーリングリストの案内