From 42de16f48d64f48c4f75be3317ad0ead3b27abef Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Thu, 6 Feb 2025 22:48:33 +0000 Subject: [PATCH] stash --- cmake/onnxruntime_providers_coreml.cmake | 25 ++++++++---------------- cmake/vcpkg.json | 7 ++++++- 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/cmake/onnxruntime_providers_coreml.cmake b/cmake/onnxruntime_providers_coreml.cmake index 3aea21dff1..0dd6e77c4b 100644 --- a/cmake/onnxruntime_providers_coreml.cmake +++ b/cmake/onnxruntime_providers_coreml.cmake @@ -169,10 +169,11 @@ elseif(TARGET nlohmann_json::nlohmann_json) endif() if(fp16_SOURCE_DIR) - target_include_directories(onnxruntime_providers_coreml PRIVATE ${fp16_SOURCE_DIR}/include) + set(FP16_INCLUDE_DIRS ${fp16_SOURCE_DIR}/include) else() - message(FATAL_ERROR "Cannot find fp16's source code") + find_path(FP16_INCLUDE_DIRS "fp16.h") endif() +target_include_directories(onnxruntime_providers_coreml PRIVATE ${FP16_INCLUDE_DIRS}) onnxruntime_add_include_to_target(onnxruntime_providers_coreml coreml_proto) target_link_libraries(onnxruntime_providers_coreml PRIVATE coreml_proto) @@ -184,26 +185,16 @@ endif() - # need to tweak the include paths to match what the coreml source code expects - target_include_directories(onnxruntime_providers_coreml PRIVATE +# need to tweak the include paths to match what the coreml source code expects +target_include_directories(onnxruntime_providers_coreml PRIVATE ${coremltools_SOURCE_DIR} ${coremltools_SOURCE_DIR}/mlmodel/src/ ${coremltools_SOURCE_DIR}/modelpackage/src/ - ) - -# need to tweak the include paths to match what the coreml source code expects -target_include_directories(onnxruntime_providers_coreml PRIVATE - ${fp16_SOURCE_DIR}/include - ${nlohmann_json_SOURCE_DIR}/single_include/nlohmann - ${coremltools_SOURCE_DIR} - ${coremltools_SOURCE_DIR}/mlmodel/src/ - ${coremltools_SOURCE_DIR}/modelpackage/src/ ) - - if (LINUX) - target_link_libraries(onnxruntime_providers_coreml PRIVATE uuid) - endif() +if (LINUX) + target_link_libraries(onnxruntime_providers_coreml PRIVATE uuid) +endif() diff --git a/cmake/vcpkg.json b/cmake/vcpkg.json index fadfd931ad..756ceb879a 100644 --- a/cmake/vcpkg.json +++ b/cmake/vcpkg.json @@ -31,7 +31,6 @@ "host": true, "version>=": "23.5.26" }, - "fp16", { "name": "flatbuffers", "version>=": "23.5.26" @@ -86,6 +85,12 @@ "dependencies": [ "xnnpack" ] + }, + "coreml-ep": { + "description": "Build with CoreML EP", + "dependencies": [ + "fp16" + ] } }, "overrides": [