Skip to content

Commit

Permalink
cmake: Fix macOS 15 python build
Browse files Browse the repository at this point in the history
  • Loading branch information
Mizux committed Dec 16, 2024
1 parent 200ade0 commit 84e6fc0
Show file tree
Hide file tree
Showing 10 changed files with 6 additions and 34 deletions.
6 changes: 0 additions & 6 deletions ortools/algorithms/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ if(APPLE)
SUFFIX ".so"
INSTALL_RPATH "@loader_path;@loader_path/../../../${PYTHON_PROJECT}/.libs"
)
set_property(TARGET knapsack_solver_pybind11 APPEND PROPERTY
LINK_FLAGS "-flat_namespace -undefined suppress"
)
elseif(UNIX)
set_target_properties(knapsack_solver_pybind11 PROPERTIES
INSTALL_RPATH "$ORIGIN:$ORIGIN/../../../${PYTHON_PROJECT}/.libs"
Expand All @@ -45,9 +42,6 @@ if(APPLE)
SUFFIX ".so"
INSTALL_RPATH "@loader_path;@loader_path/../../../${PYTHON_PROJECT}/.libs"
)
set_property(TARGET set_cover_pybind11 APPEND PROPERTY
LINK_FLAGS "-flat_namespace -undefined suppress"
)
elseif(UNIX)
set_target_properties(set_cover_pybind11 PROPERTIES
INSTALL_RPATH "$ORIGIN:$ORIGIN/../../../${PYTHON_PROJECT}/.libs"
Expand Down
6 changes: 3 additions & 3 deletions ortools/constraint_solver/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ target_compile_definitions(pywrapcp PUBLIC "PY3")
if(APPLE)
set_target_properties(pywrapcp PROPERTIES
SUFFIX ".so"
INSTALL_RPATH "@loader_path;@loader_path/../../${PROJECT_NAME}/.libs")
set_property(TARGET pywrapcp APPEND PROPERTY
LINK_FLAGS "-flat_namespace -undefined suppress")
INSTALL_RPATH "@loader_path;@loader_path/../../${PROJECT_NAME}/.libs"
)
target_link_options(pywrapcp PRIVATE "LINKER:-undefined,dynamic_lookup")
elseif(UNIX)
set_target_properties(pywrapcp PROPERTIES
INSTALL_RPATH "$ORIGIN:$ORIGIN/../../${PROJECT_NAME}/.libs")
Expand Down
3 changes: 0 additions & 3 deletions ortools/graph/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ if(APPLE)
set_target_properties(linear_sum_assignment_pybind11 PROPERTIES
SUFFIX ".so"
INSTALL_RPATH "@loader_path;@loader_path/../../../${PYTHON_PROJECT}/.libs"
LINK_FLAGS "-flat_namespace -undefined suppress"
)
elseif(UNIX)
set_target_properties(linear_sum_assignment_pybind11 PROPERTIES
Expand All @@ -37,7 +36,6 @@ if(APPLE)
set_target_properties(max_flow_pybind11 PROPERTIES
SUFFIX ".so"
INSTALL_RPATH "@loader_path;@loader_path/../../../${PYTHON_PROJECT}/.libs"
LINK_FLAGS "-flat_namespace -undefined suppress"
)
elseif(UNIX)
set_target_properties(max_flow_pybind11 PROPERTIES
Expand All @@ -55,7 +53,6 @@ if(APPLE)
set_target_properties(min_cost_flow_pybind11 PROPERTIES
SUFFIX ".so"
INSTALL_RPATH "@loader_path;@loader_path/../../../${PYTHON_PROJECT}/.libs"
LINK_FLAGS "-flat_namespace -undefined suppress"
)
elseif(UNIX)
set_target_properties(min_cost_flow_pybind11 PROPERTIES
Expand Down
3 changes: 0 additions & 3 deletions ortools/init/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ if(APPLE)
SUFFIX ".so"
INSTALL_RPATH "@loader_path;@loader_path/../../../${PYTHON_PROJECT}/.libs"
)
set_property(TARGET init_pybind11 APPEND PROPERTY
LINK_FLAGS "-flat_namespace -undefined suppress"
)
elseif(UNIX)
set_target_properties(init_pybind11 PROPERTIES
INSTALL_RPATH "$ORIGIN:$ORIGIN/../../../${PYTHON_PROJECT}/.libs"
Expand Down
9 changes: 3 additions & 6 deletions ortools/linear_solver/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ target_compile_definitions(pywraplp PUBLIC "PY3")
if(APPLE)
set_target_properties(pywraplp PROPERTIES
SUFFIX ".so"
INSTALL_RPATH "@loader_path;@loader_path/../../${PROJECT_NAME}/.libs")
set_property(TARGET pywraplp APPEND PROPERTY
LINK_FLAGS "-flat_namespace -undefined suppress")
INSTALL_RPATH "@loader_path;@loader_path/../../${PROJECT_NAME}/.libs"
)
target_link_options(pywraplp PRIVATE "LINKER:-undefined,dynamic_lookup")
elseif(UNIX)
set_target_properties(pywraplp PROPERTIES
INSTALL_RPATH "$ORIGIN:$ORIGIN/../../${PROJECT_NAME}/.libs")
Expand Down Expand Up @@ -59,9 +59,6 @@ if(APPLE)
SUFFIX ".so"
INSTALL_RPATH "@loader_path;@loader_path/../../../${PYTHON_PROJECT}/.libs"
)
set_property(TARGET model_builder_helper_pybind11 APPEND PROPERTY
LINK_FLAGS "-flat_namespace -undefined suppress"
)
elseif(UNIX)
set_target_properties(model_builder_helper_pybind11 PROPERTIES
INSTALL_RPATH "$ORIGIN:$ORIGIN/../../../${PYTHON_PROJECT}/.libs"
Expand Down
3 changes: 0 additions & 3 deletions ortools/math_opt/core/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ if(APPLE)
INSTALL_RPATH
"@loader_path;@loader_path/../../../../${PYTHON_PROJECT}/.libs;@loader_path/../../../../pybind11_abseil"
)
set_property(TARGET math_opt_pybind11 APPEND PROPERTY
LINK_FLAGS "-flat_namespace -undefined suppress"
)
elseif(UNIX)
set_target_properties(math_opt_pybind11 PROPERTIES
INSTALL_RPATH
Expand Down
1 change: 0 additions & 1 deletion ortools/pdlp/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ if(APPLE)
set_target_properties(pdlp_pybind11 PROPERTIES
SUFFIX ".so"
INSTALL_RPATH "@loader_path;@loader_path/../../../${PYTHON_PROJECT}/.libs"
LINK_FLAGS "-flat_namespace -undefined suppress"
)
elseif(UNIX)
set_target_properties(pdlp_pybind11 PROPERTIES
Expand Down
3 changes: 0 additions & 3 deletions ortools/sat/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ if(APPLE)
SUFFIX ".so"
INSTALL_RPATH "@loader_path;@loader_path/../../../${PYTHON_PROJECT}/.libs"
)
set_property(TARGET swig_helper_pybind11 APPEND PROPERTY
LINK_FLAGS "-flat_namespace -undefined suppress"
)
elseif(UNIX)
set_target_properties(swig_helper_pybind11 PROPERTIES
INSTALL_RPATH "$ORIGIN:$ORIGIN/../../../${PYTHON_PROJECT}/.libs"
Expand Down
3 changes: 0 additions & 3 deletions ortools/scheduling/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ if(APPLE)
SUFFIX ".so"
INSTALL_RPATH "@loader_path;@loader_path/../../../${PYTHON_PROJECT}/.libs"
)
set_property(TARGET rcpsp_pybind11 APPEND PROPERTY
LINK_FLAGS "-flat_namespace -undefined suppress"
)
elseif(UNIX)
set_target_properties(rcpsp_pybind11 PROPERTIES
INSTALL_RPATH "$ORIGIN:$ORIGIN/../../../${PYTHON_PROJECT}/.libs"
Expand Down
3 changes: 0 additions & 3 deletions ortools/util/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ if(APPLE)
SUFFIX ".so"
INSTALL_RPATH "@loader_path;@loader_path/../../../${PYTHON_PROJECT}/.libs"
)
set_property(TARGET sorted_interval_list_pybind11 APPEND PROPERTY
LINK_FLAGS "-flat_namespace -undefined suppress"
)
elseif(UNIX)
set_target_properties(sorted_interval_list_pybind11 PROPERTIES
INSTALL_RPATH "$ORIGIN:$ORIGIN/../../../${PYTHON_PROJECT}/.libs"
Expand Down

0 comments on commit 84e6fc0

Please sign in to comment.