3
3
4
4
use crate :: OutputLib :: { Crypto , RustWrapper , Ssl } ;
5
5
use crate :: {
6
- cargo_env, emit_warning, execute_command, is_crt_static, is_no_asm, option_env, target,
6
+ cargo_env, emit_warning, execute_command, is_crt_static, is_no_asm, is_prebuilt_nasm , option_env, target,
7
7
target_arch, target_env, target_os, target_underscored, target_vendor, OutputLibType ,
8
8
} ;
9
9
use std:: env;
@@ -135,7 +135,7 @@ impl CmakeBuilder {
135
135
136
136
// See issue: https://github.com/aws/aws-lc-rs/issues/453
137
137
if target_os ( ) == "windows" {
138
- Self :: configure_windows ( & mut cmake_cfg) ;
138
+ self . configure_windows ( & mut cmake_cfg) ;
139
139
}
140
140
141
141
// If the build environment vendor is Apple
@@ -162,13 +162,30 @@ impl CmakeBuilder {
162
162
}
163
163
164
164
if target_env ( ) == "ohos" {
165
- Self :: configure_open_harmony ( & mut cmake_cfg) ;
165
+ self . configure_open_harmony ( & mut cmake_cfg) ;
166
166
}
167
167
168
168
cmake_cfg
169
169
}
170
170
171
- fn configure_windows ( cmake_cfg : & mut cmake:: Config ) {
171
+ fn configure_windows ( & self , cmake_cfg : & mut cmake:: Config ) {
172
+ if target_arch ( ) == "x86_64" && is_prebuilt_nasm ( ) {
173
+ emit_warning ( "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" ) ;
174
+ emit_warning ( "!!! Using pre-built NASM binaries !!!" ) ;
175
+ emit_warning ( "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" ) ;
176
+
177
+ let script_path = self
178
+ . manifest_dir
179
+ . join ( "builder" )
180
+ . join ( "prebuilt-nasm.bat" )
181
+ . display ( )
182
+ . to_string ( ) ;
183
+ let script_path = script_path. replace ( r"\" , "/" ) ;
184
+
185
+ cmake_cfg. define ( "CMAKE_ASM_NASM_COMPILER" , script_path. as_str ( ) ) ;
186
+ cmake_cfg. define ( "CMAKE_VERBOSE_MAKEFILE" , "1" ) ;
187
+ }
188
+
172
189
match ( target_env ( ) . as_str ( ) , target_arch ( ) . as_str ( ) ) {
173
190
( "msvc" , "aarch64" ) => {
174
191
cmake_cfg. generator_toolset ( format ! (
@@ -200,7 +217,7 @@ impl CmakeBuilder {
200
217
}
201
218
}
202
219
203
- fn configure_open_harmony ( cmake_cfg : & mut cmake:: Config ) {
220
+ fn configure_open_harmony ( & self , cmake_cfg : & mut cmake:: Config ) {
204
221
const OHOS_NDK_HOME : & str = "OHOS_NDK_HOME" ;
205
222
if let Ok ( ndk) = env:: var ( OHOS_NDK_HOME ) {
206
223
cmake_cfg. define (
@@ -253,7 +270,11 @@ impl crate::Builder for CmakeBuilder {
253
270
let mut missing_dependency = false ;
254
271
255
272
if target_os ( ) == "windows" {
256
- if target_arch ( ) == "x86_64" && !test_nasm_command ( ) && !is_no_asm ( ) {
273
+ if target_arch ( ) == "x86_64"
274
+ && !test_nasm_command ( )
275
+ && !is_no_asm ( )
276
+ && !is_prebuilt_nasm ( )
277
+ {
257
278
eprintln ! (
258
279
"Consider setting `AWS_LC_SYS_NO_ASM` in the environment for development builds.\
259
280
See User Guide about the limitations: https://aws.github.io/aws-lc-rs/index.html"
0 commit comments