diff --git a/cmake/python.cmake b/cmake/python.cmake index 9922407aa7..9efe5230c9 100644 --- a/cmake/python.cmake +++ b/cmake/python.cmake @@ -219,25 +219,7 @@ endif() ####################### ## PYTHON WRAPPERS ## ####################### -# CMake will remove all '-D' prefix (i.e. -DUSE_FOO become USE_FOO) -#get_target_property(FLAGS ${PROJECT_NAMESPACE}::ortools COMPILE_DEFINITIONS) -set(FLAGS -DUSE_BOP -DUSE_GLOP -DABSL_MUST_USE_RESULT) -if(USE_COINOR) - list(APPEND FLAGS "-DUSE_CBC" "-DUSE_CLP") -endif() -if(USE_GLPK) - list(APPEND FLAGS "-DUSE_GLPK") -endif() -if(USE_HIGHS) - list(APPEND FLAGS "-DUSE_HIGHS") -endif() -if(USE_PDLP) - list(APPEND FLAGS "-DUSE_PDLP") -endif() -if(USE_SCIP) - list(APPEND FLAGS "-DUSE_SCIP") -endif() -list(APPEND CMAKE_SWIG_FLAGS ${FLAGS} "-I${PROJECT_SOURCE_DIR}") +list(APPEND CMAKE_SWIG_FLAGS "-I${PROJECT_SOURCE_DIR}") set(PYTHON_PROJECT ${PROJECT_NAME}) message(STATUS "Python project: ${PYTHON_PROJECT}") diff --git a/ortools/algorithms/python/CMakeLists.txt b/ortools/algorithms/python/CMakeLists.txt index 9748d0b53e..bd10034b43 100644 --- a/ortools/algorithms/python/CMakeLists.txt +++ b/ortools/algorithms/python/CMakeLists.txt @@ -14,7 +14,7 @@ set_property(SOURCE knapsack_solver.i PROPERTY CPLUSPLUS ON) set_property(SOURCE knapsack_solver.i PROPERTY SWIG_MODULE_NAME pywrapknapsack_solver) set_property(SOURCE knapsack_solver.i PROPERTY COMPILE_DEFINITIONS - ${OR_TOOLS_COMPILE_DEFINITIONS} ABSL_MUST_USE_RESULT) + ${OR_TOOLS_COMPILE_DEFINITIONS} ABSL_MUST_USE_RESULT=) swig_add_library(pywrapknapsack_solver TYPE MODULE LANGUAGE python diff --git a/ortools/constraint_solver/python/CMakeLists.txt b/ortools/constraint_solver/python/CMakeLists.txt index 70c924433f..4606db3d41 100644 --- a/ortools/constraint_solver/python/CMakeLists.txt +++ b/ortools/constraint_solver/python/CMakeLists.txt @@ -14,7 +14,7 @@ set_property(SOURCE routing.i PROPERTY CPLUSPLUS ON) set_property(SOURCE routing.i PROPERTY SWIG_MODULE_NAME pywrapcp) set_property(SOURCE routing.i PROPERTY COMPILE_DEFINITIONS - ${OR_TOOLS_COMPILE_DEFINITIONS} ABSL_MUST_USE_RESULT) + ${OR_TOOLS_COMPILE_DEFINITIONS} ABSL_MUST_USE_RESULT=) set_property(SOURCE routing.i PROPERTY COMPILE_OPTIONS -nofastunpack) swig_add_library(pywrapcp TYPE MODULE diff --git a/ortools/init/python/CMakeLists.txt b/ortools/init/python/CMakeLists.txt index 6f16231159..4669ca0885 100644 --- a/ortools/init/python/CMakeLists.txt +++ b/ortools/init/python/CMakeLists.txt @@ -14,7 +14,7 @@ set_property(SOURCE init.i PROPERTY CPLUSPLUS ON) set_property(SOURCE init.i PROPERTY SWIG_MODULE_NAME pywrapinit) set_property(SOURCE init.i PROPERTY COMPILE_DEFINITIONS - ${OR_TOOLS_COMPILE_DEFINITIONS} ABSL_MUST_USE_RESULT) + ${OR_TOOLS_COMPILE_DEFINITIONS} ABSL_MUST_USE_RESULT=) swig_add_library(pywrapinit TYPE MODULE LANGUAGE python diff --git a/ortools/linear_solver/python/CMakeLists.txt b/ortools/linear_solver/python/CMakeLists.txt index d8eda86af6..ac25c9bddd 100644 --- a/ortools/linear_solver/python/CMakeLists.txt +++ b/ortools/linear_solver/python/CMakeLists.txt @@ -14,7 +14,7 @@ set_property(SOURCE linear_solver.i PROPERTY CPLUSPLUS ON) set_property(SOURCE linear_solver.i PROPERTY SWIG_MODULE_NAME pywraplp) set_property(SOURCE linear_solver.i PROPERTY COMPILE_DEFINITIONS - ${OR_TOOLS_COMPILE_DEFINITIONS} ABSL_MUST_USE_RESULT) + ${OR_TOOLS_COMPILE_DEFINITIONS} ABSL_MUST_USE_RESULT=) swig_add_library(pywraplp TYPE MODULE LANGUAGE python diff --git a/ortools/scheduling/python/CMakeLists.txt b/ortools/scheduling/python/CMakeLists.txt index 482f343982..5350807948 100644 --- a/ortools/scheduling/python/CMakeLists.txt +++ b/ortools/scheduling/python/CMakeLists.txt @@ -14,7 +14,7 @@ set_property(SOURCE rcpsp.i PROPERTY CPLUSPLUS ON) set_property(SOURCE rcpsp.i PROPERTY SWIG_MODULE_NAME pywraprcpsp) set_property(SOURCE rcpsp.i PROPERTY COMPILE_DEFINITIONS - ${OR_TOOLS_COMPILE_DEFINITIONS} ABSL_MUST_USE_RESULT) + ${OR_TOOLS_COMPILE_DEFINITIONS} ABSL_MUST_USE_RESULT=) swig_add_library(pywraprcpsp TYPE MODULE LANGUAGE python