Skip to content

Commit fdc4189

Browse files
committed
address comments
1 parent 855b17e commit fdc4189

File tree

1 file changed

+20
-15
lines changed

1 file changed

+20
-15
lines changed

backends/apple/coreml/CMakeLists.txt

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
# Copyright © 2023 Apple Inc. All rights reserved.
2+
# Copyright (c) Meta Platforms, Inc. and affiliates.
3+
# All rights reserved.
4+
#
5+
# This source code is licensed under the BSD-style license found in the
6+
# LICENSE file in the root directory of this source tree.
27

38
cmake_minimum_required(VERSION 3.19)
49

@@ -20,6 +25,15 @@ endif()
2025

2126
option(COREML_BUILD_EXECUTOR_RUNNER "Build CoreML executor runner." OFF)
2227

28+
# inmemoryfs sources
29+
set(INMEMORYFS_SOURCES
30+
runtime/inmemoryfs/inmemory_filesystem.cpp
31+
runtime/inmemoryfs/inmemory_filesystem_utils.mm
32+
runtime/inmemoryfs/memory_buffer.cpp
33+
runtime/inmemoryfs/memory_stream.cpp
34+
runtime/inmemoryfs/reversed_memory_stream.cpp
35+
)
36+
2337
# kvstore sources
2438
set(KVSTORE_SOURCES
2539
runtime/kvstore/database.cpp runtime/kvstore/json_key_value_store.cpp
@@ -47,6 +61,9 @@ set(DELEGATE_SOURCES
4761
runtime/delegate/serde_json.mm
4862
)
4963

64+
# util sources
65+
set(UTIL_SOURCES runtime/util/json_util.cpp runtime/util/objc_json_serde.mm)
66+
5067
# sdk sources
5168
set(SDK_SOURCES
5269
runtime/sdk/ETCoreMLModelAnalyzer.mm
@@ -101,34 +118,22 @@ set(PROTOBUF_SOURCES
101118

102119
# CoreML util
103120
add_library(coreml_util)
104-
target_sources(coreml_util
105-
PRIVATE runtime/util/json_util.cpp
106-
runtime/util/objc_json_serde.mm
107-
)
121+
target_sources(coreml_util PRIVATE ${UTIL_SOURCES})
108122
target_include_directories(coreml_util
109123
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/runtime/util
110124
)
111125

112126
# CoreML inmemoryfs
113127
add_library(coreml_inmemoryfs)
114-
target_sources(coreml_inmemoryfs
115-
PRIVATE runtime/inmemoryfs/inmemory_filesystem.cpp
116-
runtime/inmemoryfs/inmemory_filesystem_utils.mm
117-
runtime/inmemoryfs/memory_buffer.cpp
118-
runtime/inmemoryfs/memory_stream.cpp
119-
runtime/inmemoryfs/reversed_memory_stream.cpp
120-
)
128+
target_sources(coreml_inmemoryfs PRIVATE ${INMEMORYFS_SOURCES})
121129
target_include_directories(coreml_inmemoryfs
122130
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/runtime/inmemoryfs
123131
)
124132
target_link_libraries(coreml_inmemoryfs PRIVATE coreml_util)
125133

126134
# Define the delegate library
127135
add_library(coremldelegate)
128-
target_sources(coremldelegate
129-
PRIVATE ${KVSTORE_SOURCES}
130-
${DELEGATE_SOURCES}
131-
)
136+
target_sources(coremldelegate PRIVATE ${KVSTORE_SOURCES} ${DELEGATE_SOURCES})
132137

133138
target_include_directories(
134139
coremldelegate PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/runtime/include

0 commit comments

Comments
 (0)