@@ -629,19 +629,10 @@ endif
629629build_shared = get_option (' default_library' ) != ' static' and get_option (' efi' ).disabled()
630630
631631if (get_option (' fips140' ).enabled())
632- # Create the official static FIPS library
633- leancrypto_static_lib_fips = static_library (' leancrypto-fips' ,
634- [ src_fips, internal_src ],
635- include_directories : [ include_dirs, include_internal_dirs ],
636- dependencies : [ leancrypto_link ],
637- link_whole : [ leancrypto_support_libs_fips ],
638- install : true
639- )
640- leancrypto_support_libs += leancrypto_static_lib_fips
641632
642633 if build_shared
643634 # Create the official shared FIPS library
644- leancrypto_lib_fips = shared_library (' leancrypto-fips' ,
635+ leancrypto_both_libs_fips = both_libraries (' leancrypto-fips' ,
645636 [ src_fips, internal_src ],
646637 include_directories : [ include_dirs,
647638 include_internal_dirs ],
@@ -650,10 +641,23 @@ if (get_option('fips140').enabled())
650641 link_whole : [ leancrypto_support_libs_fips ],
651642 install : true
652643 )
644+
645+ leancrypto_lib_fips = leancrypto_both_libs_fips.get_shared_lib()
646+ leancrypto_static_lib_fips = leancrypto_both_libs_fips.get_static_lib()
653647 else
648+ # Create the official static FIPS library
649+ leancrypto_static_lib_fips = static_library (' leancrypto-fips' ,
650+ [ src_fips, internal_src ],
651+ include_directories : [ include_dirs, include_internal_dirs ],
652+ dependencies : [ leancrypto_link ],
653+ link_whole : [ leancrypto_support_libs_fips ],
654+ install : true
655+ )
654656 leancrypto_lib_fips = leancrypto_static_lib_fips
655657 endif
656658
659+ leancrypto_support_libs += leancrypto_static_lib_fips
660+
657661 if get_option (' efi' ).disabled()
658662 pkgconfig.generate(leancrypto_lib_fips,
659663 description : ' PQC-resistant cryptographic library with FIPS -140 compliance' )
@@ -667,26 +671,28 @@ else
667671 leancrypto_support_libs += leancrypto_support_libs_fips
668672endif
669673
670- # Create the official static library
671- leancrypto_static_lib = static_library (' leancrypto' ,
672- [ src ],
673- include_directories : [ include_dirs, include_internal_dirs ],
674- dependencies : [ leancrypto_link ],
675- link_whole : [ leancrypto_support_libs ],
676- install : true
677- )
678-
679674if build_shared
680675 # Create the official shared library
681- leancrypto_lib = shared_library (' leancrypto' ,
676+ leancrypto_both_libs = both_libraries (' leancrypto' ,
682677 [ src ],
683678 include_directories : [ include_dirs, include_internal_dirs ],
684679 soversion : version_array[0 ],
685680 dependencies : [ leancrypto_link ],
686681 link_whole : [ leancrypto_support_libs ],
687682 install : true
688683 )
684+
685+ leancrypto_lib = leancrypto_both_libs.get_shared_lib()
686+ leancrypto_static_lib = leancrypto_both_libs.get_static_lib()
689687else
688+ # Create the official static library
689+ leancrypto_static_lib = static_library (' leancrypto' ,
690+ [ src ],
691+ include_directories : [ include_dirs, include_internal_dirs ],
692+ dependencies : [ leancrypto_link ],
693+ link_whole : [ leancrypto_support_libs ],
694+ install : true
695+ )
690696 leancrypto_lib = leancrypto_static_lib
691697endif
692698
0 commit comments