math_opt: Fix XCode build

an XCode target can't have two source file with the same name since xcode flatten the directory path...
This commit is contained in:
Corentin Le Molgat
2025-01-17 16:46:03 +01:00
parent accbc8dcca
commit 62d266a643
3 changed files with 4 additions and 2 deletions

View File

@@ -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>

View File

@@ -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)

View File

@@ -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