1313from core .fortran_handler import FortranHandler
1414from core .git_operations import GitManager
1515from core .github_auth import get_github_token_via_gh_cli , get_github_token_via_oauth
16- from core .models import Language , LibraryConfig
16+ from core .models import Language , LibraryConfig , LibraryType
1717from core .rust_handler import RustLibraryHandler
1818from core .subprocess_utils import run_ce_install_command
1919from core .ui_utils import (
@@ -718,6 +718,13 @@ def process_fortran_library(
718718)
719719@click .option ("--lib" , help = "Library name (for Rust) or GitHub URL (for other languages)" )
720720@click .option ("--ver" , help = "Library version (comma-separated for multiple versions)" )
721+ @click .option (
722+ "--type" ,
723+ type = click .Choice (
724+ ["header-only" , "packaged-headers" , "static" , "shared" , "cshared" ], case_sensitive = False
725+ ),
726+ help = "Library type (for C/C++ libraries)" ,
727+ )
721728def main (
722729 debug : bool ,
723730 github_token : str | None ,
@@ -729,6 +736,7 @@ def main(
729736 lang : str | None ,
730737 lib : str | None ,
731738 ver : str | None ,
739+ type : str | None ,
732740):
733741 """CLI tool to add libraries to Compiler Explorer"""
734742 if debug :
@@ -782,6 +790,18 @@ def main(
782790 elif language == Language .FORTRAN :
783791 config .library_id = FortranHandler .suggest_library_id_static (lib )
784792
793+ # Set library type if provided
794+ if type :
795+ type_map = {
796+ "header-only" : LibraryType .HEADER_ONLY ,
797+ "packaged-headers" : LibraryType .PACKAGED_HEADERS ,
798+ "static" : LibraryType .STATIC ,
799+ "shared" : LibraryType .SHARED ,
800+ "cshared" : LibraryType .CSHARED ,
801+ }
802+ config .library_type = type_map [type .lower ()]
803+ click .echo (f"✓ Using specified library type: { config .library_type .value } " )
804+
785805 # Normalize versions by checking git tags
786806 click .echo ("Checking git tags for version format..." )
787807 config .normalize_versions_with_git_lookup ()
0 commit comments