Skip to content
Snippets Groups Projects

Added Bitshift Operator

Merged Noam Zerah requested to merge noamzerah/aidge_backend_cpu:feat_operator_bitshift into dev
6 files
+ 23
23
Compare changes
  • Side-by-side
  • Inline
Files
6
function(generate_python_binding pybind_module_name target_to_bind)
function(generate_python_binding pybind_module_name target_to_bind)
add_definitions(-DPYBIND)
 
find_package(Python COMPONENTS Interpreter Development.Module)
 
Include(FetchContent)
Include(FetchContent)
set(PYBIND_VERSION v2.10.4)
set(PYBIND_VERSION v2.10.4)
set(PYBIND11_FINDPYTHON ON)
message(STATUS "Retrieving pybind ${PYBIND_VERSION} from git")
message(STATUS "Retrieving pybind ${PYBIND_VERSION} from git")
FetchContent_Declare(
FetchContent_Declare(
@@ -12,14 +13,12 @@ function(generate_python_binding pybind_module_name target_to_bind)
@@ -12,14 +13,12 @@ function(generate_python_binding pybind_module_name target_to_bind)
GIT_TAG ${PYBIND_VERSION} # or a later release
GIT_TAG ${PYBIND_VERSION} # or a later release
)
)
# Use the New FindPython mode, recommanded. Requires CMake 3.15+
find_package(Python COMPONENTS Interpreter Development.Module)
FetchContent_MakeAvailable(PyBind11)
FetchContent_MakeAvailable(PyBind11)
message(STATUS "Creating binding for module ${pybind_module_name}")
message(STATUS "Creating binding for module ${pybind_module_name}")
file(GLOB_RECURSE pybind_src_files "python_binding/*.cpp")
file(GLOB_RECURSE pybind_src_files "python_binding/*.cpp")
pybind11_add_module(${pybind_module_name} MODULE ${pybind_src_files} "NO_EXTRAS") # NO EXTRA recquired for pip install
pybind11_add_module(${pybind_module_name} MODULE ${pybind_src_files} "NO_EXTRAS") # NO EXTRA recquired for pip install
target_include_directories(${pybind_module_name} PUBLIC "python_binding")
target_include_directories(${pybind_module_name} PRIVATE "python_binding")
target_link_libraries(${pybind_module_name} PUBLIC ${target_to_bind})
target_link_libraries(${pybind_module_name} PRIVATE ${target_to_bind})
endfunction()
endfunction()
Loading