Skip to content

Commit 7482e9d

Browse files
LinuxJedidanielinux
authored andcommitted
Don't use submodule if env var is set
1 parent b602083 commit 7482e9d

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

wolfcrypt/_build_ffi.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ def checkout_version(version):
124124
def ensure_wolfssl_src(ref):
125125
""" Ensure that wolfssl sources are presents and up-to-date
126126
"""
127+
127128
if not os.path.isdir("lib"):
128129
os.mkdir("lib")
129130
with chdir("lib"):
@@ -316,15 +317,10 @@ def generate_libwolfssl():
316317
get_platform(), version))
317318
make(make_flags(prefix))
318319

319-
320-
if get_libwolfssl() == 0:
321-
generate_libwolfssl()
322-
get_libwolfssl()
323-
324320
# detect features if user has built against local wolfSSL library
325321
# if they are not, we are controlling build options above
326322
local_wolfssl = os.environ.get("USE_LOCAL_WOLFSSL")
327-
if local_wolfssl is not None:
323+
if local_wolfssl:
328324
# Try to do native wolfSSL/wolfCrypt feature detection.
329325
# Open <wolfssl/options.h> header to parse for #define's
330326
# This will throw a FileNotFoundError if not able to find options.h
@@ -341,6 +337,11 @@ def generate_libwolfssl():
341337
featureDetection = 0
342338
sys.stderr.write("\nDEBUG: Skipping native feature detection, build not "
343339
"using USE_LOCAL_WOLFSSL\n")
340+
if get_libwolfssl() == 0:
341+
generate_libwolfssl()
342+
get_libwolfssl()
343+
344+
344345

345346
# default values
346347
MPAPI_ENABLED = 1

0 commit comments

Comments
 (0)