[general]
library_name = "SuiteSparse"
library_names = {"SuiteSparse_config.h" = "libsuitesparseconfig", "SuiteSparseQR_C.h" = "libspqr", "umfpack.h" = "libumfpack", "cholmod.h" = "libcholmod", "amd.h" = "libamd"}

use_julia_native_enum_type = true
use_deterministic_symbol = true
auto_mutability = true
skip_static_functions = true

output_ignorelist = [
    # Clang.jl cannot handle these macro correctly, skip for now.
    "UMFPACK_COPYRIGHT",
    "UMFPACK_LICENSE_PART1",
    "UMFPACK_LICENSE_PART2",
    "UMFPACK_LICENSE_PART3",
    "SuiteSparse_long",
    "SuiteSparse_long_max",
    "SuiteSparse_long_id",
    "CHOLMOD_CUBLAS_HANDLE",
    "CHOLMOD_CUDASTREAM",
    "CHOLMOD_CUDAEVENT",
    # useless macros
    "CHOLMOD_CPU_GEMM_CALLS",
    "CHOLMOD_CPU_SYRK_CALLS",
    "CHOLMOD_CPU_TRSM_CALLS",
    "CHOLMOD_CPU_POTRF_CALLS",
    "CHOLMOD_GPU_GEMM_CALLS",
    "CHOLMOD_GPU_SYRK_CALLS",
    "CHOLMOD_GPU_TRSM_CALLS",
    "CHOLMOD_GPU_POTRF_CALLS",
    "CHOLMOD_CPU_GEMM_TIME",
    "CHOLMOD_CPU_SYRK_TIME",
    "CHOLMOD_CPU_TRSM_TIME",
    "CHOLMOD_CPU_POTRF_TIME",
    "CHOLMOD_GPU_GEMM_TIME",
    "CHOLMOD_GPU_SYRK_TIME",
    "CHOLMOD_GPU_TRSM_TIME",
    "CHOLMOD_GPU_POTRF_TIME",
    "CHOLMOD_ASSEMBLE_TIME",
    "CHOLMOD_ASSEMBLE_TIME2",
    "SuiteSparse_long_idd",
    "SUITESPARSE_CONFIG_TIMER",
    "SUITESPARSE_COMPILER_MAJOR",
    "SUITESPARSE_COMPILER_MINOR",
    "SUITESPARSE_COMPILER_SUB",
    "SUITESPARSE_COMPILER_NAME",
    "SUITESPARSE_STDC_VERSION",
    "SUITESPARSE_RESTRICT",
    "SUITESPARSE_LAPACK_[A-Z0-9]+",
    "SUITESPARSE_BLAS_[A-Z0-9]+",
    "SUITESPARSE_BLAS_DNRM2",
    "SUITESPARSE_BLAS_DZNRM2",
    "UMFPACK_VERSION",
]

[codegen]
use_ccall_macro = true

[codegen.macro]
macro_mode = "basic"

functionlike_macro_includelist = [
    "SUITESPARSE_VER_CODE",
    "SUITESPARSE__VERCODE",
    "CHOLMOD_VER_CODE",
    "CHOLMOD__VERCODE",
    "SPQR_VER_CODE",
    "SPQR__VERCODE",
    "AMD_VERSION_CODE",
    "AMD__VERCODE",
    "UMFPACK_VER_CODE",
    "UMFPACK__VERCODE",
    "COLAMD_VERSION_CODE",
    "COLAMD__VERCODE",
    "KLU_VERSION_CODE",
    "KLU__VERCODE",
    "BTF_VERSION_CODE",
    "BTF__VERCODE",
    "CCOLAMD_VERSION_CODE",
    "CCOLAMD__VERCODE"
]
