From 9d483c86dcb0646c0de82d87f927be555f7d26a0 Mon Sep 17 00:00:00 2001
From: mingkuang <mingkuang@live.com>
Date: Sat, 25 May 2024 20:35:14 +0800
Subject: [PATCH] =?UTF-8?q?Opt,=20=E9=BB=98=E8=AE=A4=E5=BC=80=E5=90=AF?=
 =?UTF-8?q?=E5=B9=B2=E5=87=80=E5=AF=BC=E5=85=A5=E8=A1=A8=E6=A8=A1=E5=BC=8F?=
 =?UTF-8?q?=E6=A8=A1=E5=BC=8F=EF=BC=88=E5=8A=9F=E8=83=BD=E8=BD=AC=E6=AD=A3?=
 =?UTF-8?q?=EF=BC=89?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .editorconfig                                |  3 +++
 Nuget/build/net8.0-windows7.0/VC-LTL.targets |  1 -
 VC-LTL helper for Visual Studio.props        |  5 +----
 VC-LTL helper for cmake.cmake                |  3 ---
 VC-LTL helper for nmake.cmd                  |  3 ---
 VC-LTL helper for nmake.ps1                  |  3 ---
 VC-LTL helper for qmake.pri                  |  5 +----
 config/config.cmake                          | 10 ----------
 config/config.cmd                            |  2 --
 config/config.pri                            | 15 +--------------
 config/config.props                          |  3 ---
 config/config.ps1                            |  7 -------
 ucrtbase.ucrtbase/ucrtbase.ucrtbase.vcxproj  | 12 +++++-------
 13 files changed, 11 insertions(+), 61 deletions(-)

diff --git a/.editorconfig b/.editorconfig
index 033a14a..0ad1bc8 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -14,3 +14,6 @@ indent_size = 4
 [*.{vcxproj,xml,nuspec,props,targets}]
 indent_style = space
 indent_size = 2
+
+[*.cmd]
+charset = unset
diff --git a/Nuget/build/net8.0-windows7.0/VC-LTL.targets b/Nuget/build/net8.0-windows7.0/VC-LTL.targets
index 9f87ac7..2450430 100644
--- a/Nuget/build/net8.0-windows7.0/VC-LTL.targets
+++ b/Nuget/build/net8.0-windows7.0/VC-LTL.targets
@@ -23,7 +23,6 @@
       <LTLWindowsTargetPlatformMinVersion Condition="'$(LTLWindowsTargetPlatformMinVersion)' == '' and '$(LTLPlatform)'=='x86'">5.1.2600.0</LTLWindowsTargetPlatformMinVersion>
     </PropertyGroup>
     <ItemGroup Condition="'$(LTLWindowsTargetPlatformMinVersion)' != '' and '$(LTLPlatform)' != ''">
-      <AdditionalNativeLibraryDirectories Include="$(MSBuildThisFileDirectory)..\native\TargetPlatform\$(LTLWindowsTargetPlatformMinVersion)\lib\$(LTLPlatform)\CleanImport" />
       <AdditionalNativeLibraryDirectories Include="$(MSBuildThisFileDirectory)..\native\TargetPlatform\$(LTLWindowsTargetPlatformMinVersion)\lib\$(LTLPlatform)" />
     </ItemGroup>
   </Target>
diff --git a/VC-LTL helper for Visual Studio.props b/VC-LTL helper for Visual Studio.props
index 4af79e4..d37c455 100644
--- a/VC-LTL helper for Visual Studio.props	
+++ b/VC-LTL helper for Visual Studio.props	
@@ -30,9 +30,6 @@ VC-LTL榛樿鎼滅储椤哄簭
   <PropertyGroup>
     <!--鎺у埗TargetPlatform鐗堟湰锛岀洰鍓嶅彲鐢ㄧ増鏈负 5.1.2600.0   6.0.6000.0锛堥粯璁わ級    6.2.9200.0     10.0.10240.0    10.0.19041.0-->
     <!--<WindowsTargetPlatformMinVersion>10.0.10240.0</WindowsTargetPlatformMinVersion>-->
-
-    <!--鍚敤骞插噣鐨勫鍏ヨ〃锛屾秷闄� ucrt apiset(濡傦細api-ms-win-crt-time-l1-1-0.dll)锛屾弧瓒冲己杩棁鎮h€呫€�-->
-    <!--<CleanImport>true</CleanImport>-->
   </PropertyGroup>
   <!--####################################################################################################################################################-->
 
@@ -66,4 +63,4 @@ VC-LTL榛樿鎼滅储椤哄簭
     <!--鍏煎妯″紡锛屽皾璇曞姞杞借€佺増鏈�-->
     <Import Project="$(VC_LTL_Root)\ltlvcrt.props" Condition="(!Exists('$(VC_LTL_Root)\Config\config.props')) And (Exists('$(VC_LTL_Root)\ltlvcrt.props'))"/>
   </ImportGroup>
-</Project>
\ No newline at end of file
+</Project>
diff --git a/VC-LTL helper for cmake.cmake b/VC-LTL helper for cmake.cmake
index e5eac93..76d37b2 100644
--- a/VC-LTL helper for cmake.cmake	
+++ b/VC-LTL helper for cmake.cmake	
@@ -27,9 +27,6 @@
 #鎺у埗TargetPlatform鐗堟湰锛岀洰鍓嶅彲鐢ㄧ増鏈负5.1.2600.0     6.0.6000.0锛堥粯璁わ級    6.2.9200.0     10.0.10240.0    10.0.19041.0
 #set(WindowsTargetPlatformMinVersion "10.0.10240.0")
 
-#鍚敤骞插噣鐨勫鍏ヨ〃锛屾秷闄� ucrt apiset(濡傦細api-ms-win-crt-time-l1-1-0.dll)锛屾弧瓒冲己杩棁鎮h€呫€�
-#set(CleanImport "true")
-
 ####################################################################################################################################################
 
 if(NOT VC_LTL_Root)
diff --git a/VC-LTL helper for nmake.cmd b/VC-LTL helper for nmake.cmd
index 7ba82ed..b681140 100644
--- a/VC-LTL helper for nmake.cmd	
+++ b/VC-LTL helper for nmake.cmd	
@@ -29,9 +29,6 @@
 ::控制TargetPlatform版本,目前可用版本为 5.1.2600.0    6.0.6000.0(默认)    6.2.9200.0     10.0.10240.0    10.0.19041.0
 ::set WindowsTargetPlatformMinVersion=10.0.10240.0
 
-::启用干净的导入表,消除 ucrt apiset(如:api-ms-win-crt-time-l1-1-0.dll),满足强迫症患者。
-::set CleanImport=true
-
 :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 
 
diff --git a/VC-LTL helper for nmake.ps1 b/VC-LTL helper for nmake.ps1
index 31e678e..d830fc9 100644
--- a/VC-LTL helper for nmake.ps1	
+++ b/VC-LTL helper for nmake.ps1	
@@ -29,9 +29,6 @@
 # 鎺у埗TargetPlatform鐗堟湰锛岀洰鍓嶅彲鐢ㄧ増鏈负 5.1.2600.0    6.0.6000.0锛堥粯璁わ級    6.2.9200.0     10.0.10240.0    10.0.19041.0
 # $env:WindowsTargetPlatformMinVersion="10.0.10240.0"
 
-# 鍚敤骞插噣鐨勫鍏ヨ〃锛屾秷闄� ucrt apiset(濡傦細api-ms-win-crt-time-l1-1-0.dll)锛屾弧瓒冲己杩棁鎮h€呫€�
-# $env:CleanImport="true"
-
 ################################################################################################################################
 
 do
diff --git a/VC-LTL helper for qmake.pri b/VC-LTL helper for qmake.pri
index 6a17ba3..4842918 100644
--- a/VC-LTL helper for qmake.pri	
+++ b/VC-LTL helper for qmake.pri	
@@ -1,4 +1,4 @@
-Release {
+锘縍elease {
 
 # 浣滆€咃細GPBeta锛坔ttps://github.com/GPBeta锛夛紝mingkuang锛坔ttps://github.com/mingkuang-Chuyu锛�
 # 淇敼鏃ユ湡锛�2021-08-20
@@ -30,9 +30,6 @@ Release {
 # 鎺у埗TargetPlatform鐗堟湰锛岀洰鍓嶅彲鐢ㄧ増鏈负 6.0.6000.0锛堥粯璁わ級    6.2.9200.0     10.0.10240.0    10.0.19041.0
 # WindowsTargetPlatformMinVersion = 10.0.10240.0
 
-# 鍚敤骞插噣鐨勫鍏ヨ〃锛屾秷闄� ucrt apiset(濡傦細api-ms-win-crt-time-l1-1-0.dll)锛屾弧瓒冲己杩棁鎮h€呫€�
-# CleanImport=true
-
 # -----------------------------------------------------------------------------------------------------------------------------------------------------
 
 
diff --git a/config/config.cmake b/config/config.cmake
index 1ddab4c..dcfdced 100644
--- a/config/config.cmake
+++ b/config/config.cmake
@@ -12,10 +12,6 @@ if(NOT SupportLTL)
 	set(SupportLTL "true")
 endif()
 
-if(NOT CleanImport)
-	set(CleanImport "false")
-endif()
-
 if(${SupportLTL} STREQUAL "true")
 	if(NOT CMAKE_SYSTEM_NAME)
 		message(WARNING "VC-LTL not load, because CMAKE_SYSTEM_NAME is not defined!!!")
@@ -207,12 +203,6 @@ if(${SupportLTL} STREQUAL "true")
     set(VC_LTL_Include ${VC_LTL_Root}/TargetPlatform/header;${VC_LTL_Root}/TargetPlatform/${LTLWindowsTargetPlatformMinVersion}/header)
     set(VC_LTL_Library ${VC_LTL_Root}/TargetPlatform/${LTLWindowsTargetPlatformMinVersion}/lib/${LTLPlatform})
 
-	# 濡傛灉寮€鍚簡 CleanImport 閭d箞浼樺厛浣跨敤 CleanImport
-	if(${CleanImport} STREQUAL "true")
-		if(EXISTS ${VC_LTL_Root}/TargetPlatform/${LTLWindowsTargetPlatformMinVersion}/lib/${LTLPlatform}/CleanImport)
-			set(VC_LTL_Library ${VC_LTL_Root}/TargetPlatform/${LTLWindowsTargetPlatformMinVersion}/lib/${LTLPlatform}/CleanImport;${VC_LTL_Library})
-		endif()
-	endif()
 	#message("INCLUDE " $ENV{INCLUDE})
 	#message("LIB " $ENV{LIB})
 
diff --git a/config/config.cmd b/config/config.cmd
index ae0b09d..ff8788c 100644
--- a/config/config.cmd
+++ b/config/config.cmd
@@ -84,8 +84,6 @@ echo Platform : %LTLPlatform%
 set INCLUDE=%VC_LTL_Root%TargetPlatform\header;%VC_LTL_Root%TargetPlatform\%LTLWindowsTargetPlatformMinVersion%\header;%INCLUDE%
 set LIB=%VC_LTL_Root%TargetPlatform\%LTLWindowsTargetPlatformMinVersion%\lib\%LTLPlatform%;%LIB%
 
-if /i "%CleanImport%" == "true" if exist "%VC_LTL_Root%TargetPlatform\%LTLWindowsTargetPlatformMinVersion%\lib\%LTLPlatform%\CleanImport"(set "LIB=%VC_LTL_Root%TargetPlatform\%LTLWindowsTargetPlatformMinVersion%\lib\%LTLPlatform%\CleanImport;%LIB%")
-
 goto:eof
 
 
diff --git a/config/config.pri b/config/config.pri
index 963798e..cac814a 100644
--- a/config/config.pri
+++ b/config/config.pri
@@ -1,4 +1,4 @@
-#
+锘�#
 #  璇蜂笉瑕佺洿鎺ヤ娇鐢ㄦ閰嶇疆锛屽簲璇ヤ娇鐢╒C-LTL helper for qmake.pri
 #
 
@@ -33,12 +33,6 @@ equals(LTLPlatform, x86) {
     LTLPlatform = Win32
 }
 
-# 鐜鍙橀噺閫夐」
-CleanImport = $$CleanImport
-isEmpty(CleanImport){
-    CleanImport=false
-}
-
 # 鐜鍙橀噺閫夐」
 SupportWinXP_t = $$SupportWinXP
 isEmpty(SupportWinXP_t){
@@ -125,12 +119,5 @@ QMAKE_INCDIR += \
 	$$VC_LTL_Root/TargetPlatform/header \
     $$VC_LTL_Root/TargetPlatform/$$LTLWindowsTargetPlatformMinVersion/header
 
-equals(CleanImport, true) {
-    exists($$VC_LTL_Root/TargetPlatform/$$LTLWindowsTargetPlatformMinVersion/lib/$$LTLPlatform/CleanImport) {
-        QMAKE_LIBS += \
-            -L$$VC_LTL_Root/TargetPlatform/$$LTLWindowsTargetPlatformMinVersion/lib/$$LTLPlatform/CleanImport
-    }
-}
-
 QMAKE_LIBS += \
     -L$$VC_LTL_Root/TargetPlatform/$$LTLWindowsTargetPlatformMinVersion/lib/$$LTLPlatform
diff --git a/config/config.props b/config/config.props
index 958de5e..af0f0af 100644
--- a/config/config.props
+++ b/config/config.props
@@ -109,9 +109,6 @@
 
     <VC_LTL_Include>$(VC_LTL_Root)TargetPlatform\header;$(VC_LTL_Root)TargetPlatform\$(LTLWindowsTargetPlatformMinVersion)\header</VC_LTL_Include>
     <VC_LTL_Library>$(VC_LTL_Root)TargetPlatform\$(LTLWindowsTargetPlatformMinVersion)\lib\$(Platform);$(IntDir)VC-LTL5.tmp\$(LTLWindowsTargetPlatformMinVersion)\$(Platform)</VC_LTL_Library>
-
-    <!--濡傛灉鍚敤浜嗗共鍑€瀵煎叆琛ㄦā寮忥紝閭d箞棰濆闄勫姞CleanImport鐨勮矾寰�-->
-    <VC_LTL_Library Condition="'$(CleanImport)' == 'true' and Exists('$(VC_LTL_Root)TargetPlatform\$(LTLWindowsTargetPlatformMinVersion)\lib\$(Platform)\CleanImport')">$(VC_LTL_Root)TargetPlatform\$(LTLWindowsTargetPlatformMinVersion)\lib\$(Platform)\CleanImport;$(VC_LTL_Library)</VC_LTL_Library>
   </PropertyGroup>
 
   <PropertyGroup Condition=" '$(SupportLTL)'=='true' or '$(SupportLTL)'=='ucrt'">
diff --git a/config/config.ps1 b/config/config.ps1
index b2b340b..398db0b 100644
--- a/config/config.ps1
+++ b/config/config.ps1
@@ -212,10 +212,3 @@ Write-Host  "$LTLPlatform" -ForegroundColor Green
 $env:INCLUDE="$env:VC_LTL_Root\TargetPlatform\header;$env:VC_LTL_Root\TargetPlatform\$LTLWindowsTargetPlatformMinVersion\header;$env:INCLUDE"
 $env:LIB="$env:VC_LTL_Root\TargetPlatform\$LTLWindowsTargetPlatformMinVersion\lib\$LTLPlatform;$env:LIB"
 
-if($CleanImport -ieq "true")
-{
-    if(Test-Path "$env:VC_LTL_Root\TargetPlatform\$LTLWindowsTargetPlatformMinVersion\lib\$LTLPlatform\CleanImport")
-    {
-        $env:LIB="$env:VC_LTL_Root\TargetPlatform\$LTLWindowsTargetPlatformMinVersion\lib\$LTLPlatform\CleanImport;$env:LIB"
-    }
-}
diff --git a/ucrtbase.ucrtbase/ucrtbase.ucrtbase.vcxproj b/ucrtbase.ucrtbase/ucrtbase.ucrtbase.vcxproj
index 29b4782..824b7de 100644
--- a/ucrtbase.ucrtbase/ucrtbase.ucrtbase.vcxproj
+++ b/ucrtbase.ucrtbase/ucrtbase.ucrtbase.vcxproj
@@ -833,11 +833,9 @@
     <Exec Command="%22$(SolutionDir)Tools\LibMaker.exe%22 CreateWeaks /MACHINE:$(PlatformShortName) /def:%22$(SolutionDir)Tools\Shared\ucrtbase.debug.weak.def%22 /out:%22$(IntDir)objs\weak%22" Condition="'$(UseDebugLibraries)' == 'true'" />
     <Exec Command="lib %22$(IntDir)ucrt_CleanImport.lib%22 %22$(IntDir)objs\weak\*%22" Condition="'$(UseDebugLibraries)' == 'true'" />
   </Target>
-  <Target Name="CopyFiles" AfterTargets="_Lib" Inputs="$(UniversalCRTSdkDir)Lib\$(WindowsTargetPlatformVersion)\ucrt\$(PlatformShortName)\ucrt.lib" Outputs="$(OutDir)libucrt.lib;$(OutDir)CleanImport\ucrt.lib;$(OutDir)CleanImport\libucrt.lib" Condition="'$(Configuration)' == 'Static'">
-    <Copy SourceFiles="$(UniversalCRTSdkDir)Lib\$(WindowsTargetPlatformVersion)\ucrt\$(PlatformShortName)\ucrt.lib" DestinationFiles="$(OutDir)libucrt.lib" />
-    <!--椤洪亾鍐嶄骇鐢熷共鍑€瀵煎叆琛ㄦā寮�-->
-    <MakeDir Directories="$(OutDir)CleanImport" />
-    <Copy SourceFiles="$(IntDir)ucrt_CleanImport.lib" DestinationFiles="$(OutDir)CleanImport\ucrt.lib" />
-    <Copy SourceFiles="$(IntDir)ucrt_CleanImport.lib" DestinationFiles="$(OutDir)CleanImport\libucrt.lib" />
+  <Target Name="CopyFiles" AfterTargets="_Lib" Inputs="$(IntDir)ucrt_CleanImport.lib" Outputs="$(OutDir)ucrt.lib;$(OutDir)libucrt.lib" Condition="'$(Configuration)' == 'Static'">
+    <!--澶嶅埗骞插噣瀵煎叆琛ㄧ殑UCRT搴�-->
+    <Copy SourceFiles="$(IntDir)ucrt_CleanImport.lib" DestinationFiles="$(OutDir)ucrt.lib" />
+    <Copy SourceFiles="$(IntDir)ucrt_CleanImport.lib" DestinationFiles="$(OutDir)libucrt.lib" />
   </Target>
-</Project>
\ No newline at end of file
+</Project>