From a38f240b690261fa040946d127ae0419f4e8dd1a Mon Sep 17 00:00:00 2001 From: Corentin Le Molgat Date: Fri, 17 Jan 2025 16:46:03 +0100 Subject: [PATCH] math_opt: Fix XCode build an XCode target can't have two source file with the same name since xcode flatten the directory path... --- ortools/math_opt/CMakeLists.txt | 1 + ortools/math_opt/core/CMakeLists.txt | 4 +++- ortools/math_opt/core/c_api/CMakeLists.txt | 1 - 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ortools/math_opt/CMakeLists.txt b/ortools/math_opt/CMakeLists.txt index 82e204fafd..dffc756574 100644 --- a/ortools/math_opt/CMakeLists.txt +++ b/ortools/math_opt/CMakeLists.txt @@ -29,6 +29,7 @@ set(NAME ${PROJECT_NAME}_math_opt) add_library(${NAME} OBJECT) target_sources(${NAME} PUBLIC $ + $ $ $ $ diff --git a/ortools/math_opt/core/CMakeLists.txt b/ortools/math_opt/core/CMakeLists.txt index e8ac932486..6d01327ad7 100644 --- a/ortools/math_opt/core/CMakeLists.txt +++ b/ortools/math_opt/core/CMakeLists.txt @@ -11,8 +11,10 @@ # See the License for the specific language governing permissions and # limitations under the License. +add_subdirectory(c_api) + file(GLOB _SRCS "*.h" "*.cc") -list(APPEND _SRCS "${CMAKE_CURRENT_SOURCE_DIR}/c_api/solver.cc") +#list(APPEND _SRCS "${CMAKE_CURRENT_SOURCE_DIR}/c_api/solver.cc") list(FILTER _SRCS EXCLUDE REGEX "/[^/]*_test\\.cc$") set(NAME ${PROJECT_NAME}_math_opt_core) diff --git a/ortools/math_opt/core/c_api/CMakeLists.txt b/ortools/math_opt/core/c_api/CMakeLists.txt index cf90901505..ced63647a3 100644 --- a/ortools/math_opt/core/c_api/CMakeLists.txt +++ b/ortools/math_opt/core/c_api/CMakeLists.txt @@ -13,7 +13,6 @@ set(NAME ${PROJECT_NAME}_math_opt_core_c_api) add_library(${NAME} OBJECT) - target_sources(${NAME} PRIVATE solver.h solver.cc) set_target_properties(${NAME} PROPERTIES POSITION_INDEPENDENT_CODE ON) target_include_directories(${NAME} PUBLIC