3636ExternalLibPath = Path (RepositoryRootPath / "External" )
3737
3838
39- ##############################
40- # zlib
41- ##############################
42- def BuildAndInstallZlib (
43- buildEnv : EnvironmentConfig .EnvironmentConfiguration ,
44- buildConfig : EnvironmentConfig .BuildConfig = EnvironmentConfig .BuildConfig .DEBUG ,
45- ):
46- ProjectName = "zlib"
47-
48- BuildTypeString = EnvironmentConfig .BuildConfig .ToCMakeBuildType (buildConfig )
49- targetPlatformString = EnvironmentConfig .Platform .PlatformToOsName (
50- buildEnv .GetTargetPlatform ()
51- )
52-
53- TopLevelCMakeListsDirectory = Path (ExternalLibPath / ProjectName )
54- BuildDirectory = Path (
55- ExternalLibPath / ProjectName / "Build" / targetPlatformString / BuildTypeString
56- )
57- InstallDirectory = Path (
58- ExternalLibPath
59- / ProjectName
60- / "Install"
61- / targetPlatformString
62- / BuildTypeString
63- )
64-
65- if not BuildDirectory .exists ():
66- BuildDirectory .mkdir (parents = True )
67-
68- if InstallDirectory .exists ():
69- shutil .rmtree (InstallDirectory )
70- InstallDirectory .mkdir (parents = True )
71-
72- os .chdir (RepositoryRootPath )
73-
74- print ("==============================" )
75- print (ProjectName + ": Configuring ({})" .format (BuildTypeString ))
76- print ("==============================" )
77- configureCommand = 'cmake -G "{0}" -DCMAKE_TOOLCHAIN_FILE="{1}" -S {2} -B {3} -DCMAKE_INSTALL_PREFIX="{4}" -DZLIB_BUILD_EXAMPLES=OFF -DCMAKE_BUILD_TYPE={5} -DZLIB_BUILD_SHARED=OFF' .format (
78- buildEnv .GetCmakeGenerator (),
79- buildEnv .GetCustomToolChainPath (),
80- TopLevelCMakeListsDirectory ,
81- BuildDirectory ,
82- InstallDirectory ,
83- BuildTypeString ,
84- )
85- print (configureCommand )
86- subprocess .run (
87- configureCommand ,
88- shell = True ,
89- check = True ,
90- )
91-
92- print ("==============================" )
93- print (ProjectName + ": Building ({})" .format (BuildTypeString ))
94- print ("==============================" )
95- buildCommand = "cmake --build {0} -- -j 4" .format (BuildDirectory )
96- print (buildCommand )
97- subprocess .run (
98- buildCommand ,
99- shell = True ,
100- check = True ,
101- )
102-
103- print ("==============================" )
104- print (ProjectName + ": Installing ({})" .format (BuildTypeString ))
105- print ("==============================" )
106- installCommand = "cmake --install {0}" .format (BuildDirectory )
107- print (installCommand )
108- subprocess .run (
109- installCommand ,
110- shell = True ,
111- check = True ,
112- )
113-
114-
11539##############################
11640# minizip-ng
11741##############################
@@ -170,7 +94,9 @@ def BuildAndInstallMinizipNg(
17094 print ("==============================" )
17195 print (ProjectName + ": Building ({})" .format (BuildTypeString ))
17296 print ("==============================" )
173- buildCommand = "cmake --build {0}" .format (BuildDirectory )
97+ buildCommand = "cmake --build {0} --config {1} -- -j 4" .format (
98+ BuildDirectory , BuildTypeString
99+ )
174100 print (buildCommand )
175101 subprocess .run (
176102 buildCommand ,
@@ -194,10 +120,6 @@ def BuildAndInstallMinizipNg(
194120 RepositoryRootPath , targetPlatform
195121)
196122
197- # zlib
198- BuildAndInstallZlib (BuildEnv , EnvironmentConfig .BuildConfig .DEBUG )
199- BuildAndInstallZlib (BuildEnv , EnvironmentConfig .BuildConfig .RELEASE )
200-
201123# minizip-ng
202124BuildAndInstallMinizipNg (BuildEnv , EnvironmentConfig .BuildConfig .DEBUG )
203125BuildAndInstallMinizipNg (BuildEnv , EnvironmentConfig .BuildConfig .RELEASE )
0 commit comments