Skip to content

Commit

Permalink
Add cmake option to anable/disable bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
sovrasov committed Jan 10, 2025
1 parent f9019e0 commit ad44de2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 5 additions & 1 deletion model_api/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

cmake_minimum_required(VERSION 3.26)

option(ENABLE_PY_BINDINGS "Enables building python bindings package" ON)

# Multi config generators such as Visual Studio ignore CMAKE_BUILD_TYPE. Multi config generators are configured with
# CMAKE_CONFIGURATION_TYPES, but limiting options in it completely removes such build options
get_property(GENERATOR_IS_MULTI_CONFIG_VAR GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
Expand Down Expand Up @@ -84,7 +86,9 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "^GNU|(Apple)?Clang$")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
endif()

add_subdirectory(py_bindings)
if (ENABLE_PY_BINDINGS)
add_subdirectory(py_bindings)
endif()

include(GenerateExportHeader)

Expand Down
2 changes: 0 additions & 2 deletions model_api/cpp/py_bindings/py_classificaiton.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/*
* Copyright (C) 2025 Intel Corporation
* SPDX-License-Identifier: Apache-2.0
Expand Down Expand Up @@ -54,7 +53,6 @@ void init_classification(nb::module_& m) {
},
nb::rv_policy::reference_internal);


nb::class_<ClassificationModel, ImageModel>(m, "ClassificationModel")
.def_static(
"create_model",
Expand Down

0 comments on commit ad44de2

Please sign in to comment.