Skip to content

Commit

Permalink
math_opt: Fix XCode build
Browse files Browse the repository at this point in the history
an XCode target can't have two source file with the same name since xcode flatten the directory path...
  • Loading branch information
Mizux committed Jan 17, 2025
1 parent b3a9359 commit a38f240
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions ortools/math_opt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ set(NAME ${PROJECT_NAME}_math_opt)
add_library(${NAME} OBJECT)
target_sources(${NAME} PUBLIC
$<TARGET_OBJECTS:${NAME}_core>
$<TARGET_OBJECTS:${NAME}_core_c_api>
$<TARGET_OBJECTS:${NAME}_cpp>
$<TARGET_OBJECTS:${NAME}_io>
$<TARGET_OBJECTS:${NAME}_labs>
Expand Down
4 changes: 3 additions & 1 deletion ortools/math_opt/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion ortools/math_opt/core/c_api/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a38f240

Please sign in to comment.