Projects STRLCPY LIEF Commits b0f421bd
🤬
  • ■ ■ ■ ■ ■
    api/python/CMakeLists.txt
    skipped 36 lines
    37 37  message(STATUS "Python include: ${Python_INCLUDE_DIRS}")
    38 38  message(STATUS "Python interpreter: ${Python_EXECUTABLE}")
    39 39   
     40 +set(NANOBIND_OPT
     41 + NB_STATIC
     42 + NOMINSIZE
     43 +)
     44 + 
     45 +if (LIEF_PYTHON_STATIC)
     46 + list(APPEND NANOBIND_OPT NB_EXT_STATIC)
     47 +endif()
     48 + 
    40 49  nanobind_add_module(
    41 50   pyLIEF
    42  - NB_STATIC
    43  - # Do not default to -Os
    44  - NOMINSIZE
     51 + ${NANOBIND_OPT}
    45 52   
    46 53   src/pyLIEF.cpp
    47 54  )
    skipped 20 lines
    68 75  endif()
    69 76   
    70 77  if (UNIX)
    71  - # Even on osx (c.f. EXT_SUFFIX from sysconfig)
    72  - set_target_properties(pyLIEF PROPERTIES SUFFIX ".so")
     78 + if (LIEF_PYTHON_STATIC)
     79 + set_target_properties(pyLIEF PROPERTIES SUFFIX ".a")
     80 + else()
     81 + # Even on osx (c.f. EXT_SUFFIX from sysconfig)
     82 + set_target_properties(pyLIEF PROPERTIES SUFFIX ".so")
     83 + endif()
    73 84  elseif(WIN32)
    74  - set_target_properties(pyLIEF PROPERTIES SUFFIX ".pyd")
     85 + if (LIEF_PYTHON_STATIC)
     86 + set_target_properties(pyLIEF PROPERTIES SUFFIX ".lib")
     87 + else()
     88 + set_target_properties(pyLIEF PROPERTIES SUFFIX ".pyd")
     89 + endif()
    75 90  endif()
    76 91   
    77 92  if (WIN32)
    skipped 8 lines
    86 101   endif()
    87 102  endif()
    88 103   
     104 +if (LIEF_PYTHON_STATIC)
     105 + install(TARGETS nanobind-static pyLIEF
     106 + DESTINATION lib/python-${Python_VERSION})
     107 + 
     108 + install(
     109 + DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/lief
     110 + DESTINATION lib/python/typing
     111 + FILES_MATCHING
     112 + REGEX "(.*).(pyi)$")
     113 + 
     114 + install(DIRECTORY ${NB_DIR}/include/
     115 + DESTINATION include/)
     116 +endif()
     117 + 
  • ■ ■ ■ ■ ■ ■
    api/python/lief/ELF.pyi
    skipped 667 lines
    668 668   def __getitem__(self, arg: int, /) -> lief.ELF.CoreFile.entry_t: ...
    669 669   @overload
    670 670   def __getitem__(self, arg: slice, /) -> lief.ELF.CoreFile.files_t: ...
    671  - def __iter__(self) -> Iterator: ...
     671 + def __iter__(self) -> Iterator[lief.ELF.CoreFile.entry_t]: ...
    672 672   def __len__(self) -> int: ...
    673 673   @overload
    674 674   def __setitem__(self, arg0: int, arg1: lief.ELF.CoreFile.entry_t, /) -> None: ...
    skipped 1 lines
    676 676   def __setitem__(self, arg0: slice, arg1: lief.ELF.CoreFile.files_t, /) -> None: ...
    677 677   files: lief.ELF.CoreFile.files_t
    678 678   def __init__(self, *args, **kwargs) -> None: ...
    679  - def __iter__(self) -> Iterator: ...
     679 + def __iter__(self) -> Iterator[lief.ELF.CoreFile.entry_t]: ...
    680 680   def __len__(self) -> int: ...
    681 681   
    682 682  class CorePrPsInfo(Note):
    skipped 2485 lines
  • ■ ■ ■ ■ ■ ■
    cmake/LIEFOptions.cmake
    skipped 30 lines
    31 31  cmake_dependent_option(LIEF_PYTHON_EDITABLE "Make an editable build " OFF
    32 32   "LIEF_PYTHON_API" OFF)
    33 33   
     34 +cmake_dependent_option(LIEF_PYTHON_STATIC "Internal usage" OFF
     35 + "LIEF_PYTHON_API" OFF)
     36 + 
    34 37  # OAT support relies on the ELF and DEX format.
    35 38  # Therefore, these options must be enabled to support use this format
    36 39  cmake_dependent_option(LIEF_OAT "Build LIEF with OAT module" ON
    skipped 151 lines
Please wait...
Page is in error, reload to recover