Skip to content

Commit a38f240

Browse files
committed
math_opt: Fix XCode build
an XCode target can't have two source file with the same name since xcode flatten the directory path...
1 parent b3a9359 commit a38f240

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

ortools/math_opt/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ set(NAME ${PROJECT_NAME}_math_opt)
2929
add_library(${NAME} OBJECT)
3030
target_sources(${NAME} PUBLIC
3131
$<TARGET_OBJECTS:${NAME}_core>
32+
$<TARGET_OBJECTS:${NAME}_core_c_api>
3233
$<TARGET_OBJECTS:${NAME}_cpp>
3334
$<TARGET_OBJECTS:${NAME}_io>
3435
$<TARGET_OBJECTS:${NAME}_labs>

ortools/math_opt/core/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@
1111
# See the License for the specific language governing permissions and
1212
# limitations under the License.
1313

14+
add_subdirectory(c_api)
15+
1416
file(GLOB _SRCS "*.h" "*.cc")
15-
list(APPEND _SRCS "${CMAKE_CURRENT_SOURCE_DIR}/c_api/solver.cc")
17+
#list(APPEND _SRCS "${CMAKE_CURRENT_SOURCE_DIR}/c_api/solver.cc")
1618
list(FILTER _SRCS EXCLUDE REGEX "/[^/]*_test\\.cc$")
1719

1820
set(NAME ${PROJECT_NAME}_math_opt_core)

ortools/math_opt/core/c_api/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
set(NAME ${PROJECT_NAME}_math_opt_core_c_api)
1515
add_library(${NAME} OBJECT)
16-
1716
target_sources(${NAME} PRIVATE solver.h solver.cc)
1817
set_target_properties(${NAME} PROPERTIES POSITION_INDEPENDENT_CODE ON)
1918
target_include_directories(${NAME} PUBLIC

0 commit comments

Comments
 (0)