@@ -6,13 +6,25 @@ task prepareOpenSSLDirectories {
66 }
77}
88
9+ project. tasks. create(" downloadJom" , Download ) {
10+ src ' https://qt.mirror.constant.com/official_releases/jom/jom_1_1_3.zip'
11+ dest buildDir
12+ overwrite false
13+ }
14+
15+ project. tasks. create(" unzipJom" , Copy ) {
16+ dependsOn downloadJom
17+ from zipTree(" $buildDir /jom_1_1_3.zip" )
18+ into " $buildDir /jom"
19+ }
20+
921// Runs the configure step.
1022project. tasks. create(" configureOpenSSL" , Exec ) {
1123 // OpenSSL is configured with Perl. We want to build static libraries and specify
1224 // a custom installation location.
1325 executable " perl"
1426 def configureLocation = project. file(" $project . openssl_dir /Configure" )
15- args configureLocation, " no-shared" , " --prefix=${ project.openssl_install} " , " --libdir=lib"
27+ args configureLocation, " no-shared" , " no-tests " , " --prefix=${ project.openssl_install} " , " --libdir=lib"
1628 workingDir project. openssl_build_dir
1729
1830 // Add the arch specifier for Windows.
@@ -24,6 +36,8 @@ project.tasks.create("configureOpenSSL", Exec) {
2436 } else {
2537 args " VC-WIN64A"
2638 }
39+ args " /FS"
40+ dependsOn unzipJom
2741 } else if (project. platform == " osx-arm64" ) {
2842 args " darwin64-arm64-cc"
2943 environment " ARCHFLAGS" , " -arch arm64"
@@ -55,39 +69,35 @@ project.tasks.create("configureOpenSSL", Exec) {
5569 dependsOn prepareOpenSSLDirectories
5670}
5771
58- def make = project. platform. contains(" windows" ) ? " nmake " : " make"
72+ def make = project. platform. contains(" windows" ) ? " $b uildDir /jom/jom.exe " : " make"
5973
6074// Runs the build step.
6175project. tasks. create(" buildOpenSSL" , Exec ) {
6276 // Make sure that we are configured.
6377 dependsOn " configureOpenSSL"
6478
65- // OpenSSL is built with make on UNIX and nmake on Windows.
66- executable make
67- workingDir project. openssl_build_dir
68-
69- // UNIX supports building with multiple workers.
70- if (! project. platform. contains(" windows" ))
71- args " -j${ project.processors} "
72- }
73-
74- // Runs the install step.
75- project. tasks. create(" installOpenSSL" , Exec ) {
76- // Make sure that we have built.
77- dependsOn " buildOpenSSL"
78-
79- // OpenSSL is installed with make on UNIX and nmake on Windows.
79+ // OpenSSL is built with make on UNIX and jom on Windows.
8080 executable make
81- args " install_sw "
81+ args " install_dev "
8282 workingDir project. openssl_build_dir
8383
84- // UNIX supports installing with multiple workers.
85- if (! project. platform. contains(" windows" ))
86- args " -j${ project.processors} "
84+ args " -j${ project.processors} "
8785}
8886
8987// Create a "mega-task" that builds everything.
9088project. tasks. create(" openSSL" ) {
91- dependsOn " installOpenSSL "
89+ dependsOn " buildOpenSSL "
9290 outputs. dir(project. openssl_install)
91+
92+ if (project. platform. contains(" windows" )) {
93+ doLast {
94+ copy {
95+ from " $project . openssl_install /lib/libcrypto.lib"
96+ from " $project . openssl_install /lib/libssl.lib"
97+ into " $project . openssl_install /lib"
98+ rename(" libcrypto.lib" , " libcryptod.lib" )
99+ rename(" libssl.lib" , " libssld.lib" )
100+ }
101+ }
102+ }
93103}
0 commit comments