[ttssh2-commit] [9753] cmakeビルド時 libressl がビルドできないVSの時はビルドしない

Back to archive index
scmno****@osdn***** scmno****@osdn*****
2022年 2月 18日 (金) 23:42:23 JST


Revision: 9753
          https://osdn.net/projects/ttssh2/scm/svn/commits/9753
Author:   zmatsuo
Date:     2022-02-18 23:42:23 +0900 (Fri, 18 Feb 2022)
Log Message:
-----------
cmakeビルド時 libressl がビルドできないVSの時はビルドしない

- stdint.h が使われている
  - Visual Stuio 2010 から入ってる
- Release時もlibresslのデバグ版をリンクしていたので修正

Modified Paths:
--------------
    trunk/CMakeLists.txt
    trunk/libs/buildall.cmake
    trunk/libs/buildlibressl.cmake
    trunk/libs/lib_libressl.cmake

-------------- next part --------------
Modified: trunk/CMakeLists.txt
===================================================================
--- trunk/CMakeLists.txt	2022-02-18 14:32:01 UTC (rev 9752)
+++ trunk/CMakeLists.txt	2022-02-18 14:42:23 UTC (rev 9753)
@@ -3,7 +3,8 @@
 
 project(teraterm_all)
 
-if(${CMAKE_GENERATOR} MATCHES "Visual Studio 8 2005")
+if(MSVC AND (MSVC_VERSION LESS_EQUAL 1400))
+  # Visual Studio 2005 (1400=VS2005)
   set(SUPPORT_OLD_WINDOWS_DEFAULT ON)
 else()
   set(SUPPORT_OLD_WINDOWS_DEFAULT OFF)
@@ -22,7 +23,8 @@
 
 #set(_WIN32_WINNT "0x0a00") # 0x0a00=_WIN32_WINNT_WIN10
 #set(_WIN32_WINNT "0x0501") # Tera Term がビルドできる最小値
-if(${CMAKE_GENERATOR} MATCHES "Visual Studio 8 2005" OR ${CMAKE_GENERATOR} MATCHES "Visual Studio 9 2008")
+if(MSVC AND (MSVC_VERSION LESS_EQUAL 1500))
+  # Visual Studio 2005, 2008  (1500=VS2008)
   set(_WIN32_WINNT "0x0501")
   set(TTXSSH OFF)
 endif()

Modified: trunk/libs/buildall.cmake
===================================================================
--- trunk/libs/buildall.cmake	2022-02-18 14:32:01 UTC (rev 9752)
+++ trunk/libs/buildall.cmake	2022-02-18 14:42:23 UTC (rev 9753)
@@ -15,6 +15,16 @@
   set(ARCHITECTURE_OPTION -DARCHITECTURE=${ARCHITECTURE})
 endif()
 
+if(NOT DEFINED BUILD_SSL_LIBRARY)
+  if(NOT(${CMAKE_GENERATOR} MATCHES "Visual Studio 8 2005" OR ${CMAKE_GENERATOR} MATCHES "Visual Studio 9 2008"))
+    set(BUILD_SSL_LIBRARY OFF)
+  else()
+    set(BUILD_SSL_LIBRARY ON)
+  endif()
+endif()
+
+message("BUILD_SSL_LIBRARY=${BUILD_SSL_LIBRARY}")
+
 # install tools
 if("${CMAKE_GENERATOR}" MATCHES "Visual Studio")
   if(NOT EXISTS c:/Strawberry/perl/bin/perl.exe)
@@ -43,10 +53,12 @@
 execute_process(
   COMMAND ${CMAKE_COMMAND} -DCMAKE_GENERATOR=${CMAKE_GENERATOR} ${ARCHITECTURE_OPTION} -P SFMT.cmake
   )
-message("openssl 1.1")
-execute_process(
-  COMMAND ${CMAKE_COMMAND} -DCMAKE_GENERATOR=${CMAKE_GENERATOR} ${ARCHITECTURE_OPTION} -P openssl11.cmake
-  )
+if(BUILD_SSL_LIBRARY)
+  message("openssl 1.1")
+  execute_process(
+    COMMAND ${CMAKE_COMMAND} -DCMAKE_GENERATOR=${CMAKE_GENERATOR} ${ARCHITECTURE_OPTION} -P openssl11.cmake
+    )
+endif(BUILD_SSL_LIBRARY)
 message("cJSON")
 execute_process(
   COMMAND ${CMAKE_COMMAND} -P cJSON.cmake
@@ -55,9 +67,11 @@
 execute_process(
   COMMAND ${CMAKE_COMMAND} -P argon2.cmake
   )
-message("libressl")
-execute_process(
-  COMMAND ${CMAKE_COMMAND} -DCMAKE_GENERATOR=${CMAKE_GENERATOR} ${ARCHITECTURE_OPTION} -P buildlibressl.cmake
-  )
+if(BUILD_SSL_LIBRARY)
+  message("libressl")
+  execute_process(
+    COMMAND ${CMAKE_COMMAND} -DCMAKE_GENERATOR=${CMAKE_GENERATOR} ${ARCHITECTURE_OPTION} -P buildlibressl.cmake
+    )
+endif(BUILD_SSL_LIBRARY)
 
 message("done buildall.cmake")

Modified: trunk/libs/buildlibressl.cmake
===================================================================
--- trunk/libs/buildlibressl.cmake	2022-02-18 14:32:01 UTC (rev 9752)
+++ trunk/libs/buildlibressl.cmake	2022-02-18 14:42:23 UTC (rev 9753)
@@ -116,7 +116,7 @@
     endif(CMAKE_HOST_UNIX)
     list(APPEND GENERATE_OPTIONS "-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}")
     list(APPEND GENERATE_OPTIONS "-DCMAKE_BUILD_TYPE=Release")
-    if("${CMAKE_GENERATOR}" MATCHES "Visual Studio")
+    if(("${CMAKE_GENERATOR}" MATCHES "Visual Studio") OR ("${CMAKE_GENERATOR}" MATCHES "NMake Makefiles"))
       list(APPEND GENERATE_OPTIONS "-DMSVC=on")
       list(APPEND GENERATE_OPTIONS "-DUSE_STATIC_MSVC_RUNTIMES=on")
     endif()

Modified: trunk/libs/lib_libressl.cmake
===================================================================
--- trunk/libs/lib_libressl.cmake	2022-02-18 14:32:01 UTC (rev 9752)
+++ trunk/libs/lib_libressl.cmake	2022-02-18 14:42:23 UTC (rev 9753)
@@ -22,6 +22,6 @@
 
   set(LIBRESSL_LIB
     debug ${LIBRESSL_ROOT}/lib/crypto-47d.lib
-    optimized ${LIBRESSL_ROOT}/lib/crypto-47d.lib
+    optimized ${LIBRESSL_ROOT}/lib/crypto-47.lib
     )
 endif()


ttssh2-commit メーリングリストの案内
Back to archive index