[ttssh2-commit] [10503] REMOVE_TMP 環境変数を設定すると、ダウンロードアーカイブファイルを削除する

Back to archive index
scmno****@osdn***** scmno****@osdn*****
2023年 1月 16日 (月) 22:24:36 JST


Revision: 10503
          https://osdn.net/projects/ttssh2/scm/svn/commits/10503
Author:   zmatsuo
Date:     2023-01-16 22:24:36 +0900 (Mon, 16 Jan 2023)
Log Message:
-----------
REMOVE_TMP 環境変数を設定すると、ダウンロードアーカイブファイルを削除する

- ビルド後のソースツリーサイズを削減するため
- 設定内容はチェックしていない
  `set REMOVE_TMP=ON` など

Modified Paths:
--------------
    trunk/buildtools/install_cygwin.cmake
    trunk/buildtools/install_innosetup.cmake

-------------- next part --------------
Modified: trunk/buildtools/install_cygwin.cmake
===================================================================
--- trunk/buildtools/install_cygwin.cmake	2023-01-16 13:24:27 UTC (rev 10502)
+++ trunk/buildtools/install_cygwin.cmake	2023-01-16 13:24:36 UTC (rev 10503)
@@ -1,6 +1,12 @@
 # install cygwin in this folder
 #  cmake -P install_cygwin.cmake
+#  cmake -DREMOVE_TMP=ON -P install_cygwin.cmake
 set(CYGWIN_ROOT "${CMAKE_CURRENT_LIST_DIR}/cygwin64")
+if(DEFINED ENV{REMOVE_TMP})
+  set(REMOVE_TMP ON)
+else()
+  option(REMOVE_TMP "" OFF)
+endif()
 
 # cygroot
 if(EXISTS "${CYGWIN_ROOT}")
@@ -32,6 +38,12 @@
   WORKING_DIRECTORY ${CYGWIN_ROOT}
 )
 
+# remove archives
+if(REMOVE_TMP)
+  file(GLOB ARC_FILES "${PACKAGE}/http*")
+  file(REMOVE_RECURSE ${ARC_FILES})
+endif()
+
 ##############################
 # cygwin 32bit from time machine
 #  http://www.crouchingtigerhiddenfruitbat.org/Cygwin/timemachine.html
@@ -62,3 +74,9 @@
   COMMAND ${SETUP} -X --quiet-mode --wait --no-admin --root ${CYGWIN_ROOT} --site ${DOWNLOAD_SITE} --local-package-dir ${PACKAGE} --packages cygwin32-gcc-g++
   WORKING_DIRECTORY ${CYGWIN_ROOT}
 )
+
+# remove archives
+if(REMOVE_TMP)
+  file(GLOB ARC_FILES "${PACKAGE}/http*")
+  file(REMOVE_RECURSE ${ARC_FILES})
+endif()

Modified: trunk/buildtools/install_innosetup.cmake
===================================================================
--- trunk/buildtools/install_innosetup.cmake	2023-01-16 13:24:27 UTC (rev 10502)
+++ trunk/buildtools/install_innosetup.cmake	2023-01-16 13:24:36 UTC (rev 10503)
@@ -1,4 +1,9 @@
 # cmake -P innosetup.cmake
+if(DEFINED ENV{REMOVE_TMP})
+  set(REMOVE_TMP ON)
+else()
+  option(REMOVE_TMP "" OFF)
+endif()
 
 # check innosetup
 #   6.2.1
@@ -34,7 +39,10 @@
 execute_process(
   COMMAND ../download/unrar/${UNRAR_ZIP} /s
   WORKING_DIRECTORY "unrar"
-  )
+)
+if(REMOVE_TMP)
+  file(REMOVE_RECURSE "download/unrar")
+endif()
 
 # innounp
 set(INNOUNP_RAR "innounp050.rar")
@@ -55,6 +63,9 @@
   COMMAND ../unrar/UnRAR.exe x ../download/innounp/${INNOUNP_RAR}
   WORKING_DIRECTORY "innounp"
   )
+if(REMOVE_TMP)
+  file(REMOVE_RECURSE "download/innounp")
+endif()
 
 # innosetup 6
 set(INNOSETUP_EXE "innosetup-6.2.1.exe")
@@ -76,3 +87,6 @@
   )
 file(RENAME "innosetup6/{app}" innosetup6/bin)
 file(RENAME "innosetup6/{tmp}" innosetup6/tmp)
+if(REMOVE_TMP)
+  file(REMOVE_RECURSE "download/innosetup6")
+endif()


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