File tree 2 files changed +28
-19
lines changed
2 files changed +28
-19
lines changed Original file line number Diff line number Diff line change @@ -128,22 +128,6 @@ else()
128
128
set (CMAKE_CXX_FLAGS_RELEASE "-O2 ${CMAKE_CXX_FLAGS_RELEASE} " )
129
129
endif ()
130
130
131
- #
132
- # pthreadpool: build pthreadpool library. Disable on unsupported platforms
133
- #
134
- cmake_dependent_option(
135
- EXECUTORCH_BUILD_PTHREADPOOL "Build pthreadpool library." ON
136
- "NOT EXECUTORCH_BUILD_ARM_BAREMETAL" OFF
137
- )
138
-
139
- #
140
- # cpuinfo: build cpuinfo library. Disable on unsupported platforms
141
- #
142
- cmake_dependent_option(
143
- EXECUTORCH_BUILD_CPUINFO "Build cpuinfo library." ON
144
- "NOT EXECUTORCH_BUILD_ARM_BAREMETAL" OFF
145
- )
146
-
147
131
add_subdirectory (third-party)
148
132
149
133
if (EXECUTORCH_BUILD_EXTENSION_TRAINING)
@@ -569,9 +553,7 @@ if(EXECUTORCH_BUILD_EXTENSION_TENSOR)
569
553
add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR} /extension/tensor)
570
554
endif ()
571
555
572
- if (EXECUTORCH_BUILD_PTHREADPOOL
573
- AND EXECUTORCH_BUILD_CPUINFO
574
- )
556
+ if (EXECUTORCH_BUILD_PTHREADPOOL AND EXECUTORCH_BUILD_CPUINFO)
575
557
add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR} /extension/threadpool)
576
558
endif ()
577
559
Original file line number Diff line number Diff line change @@ -205,6 +205,24 @@ define_overridable_option(
205
205
BOOL ON
206
206
)
207
207
208
+ if (EXECUTORCH_BUILD_ARM_BAREMETAL)
209
+ set (_default_executorch_build_pthreadpool OFF )
210
+ set (_default_executorch_build_cpuinfo OFF )
211
+ else ()
212
+ set (_default_executorch_build_pthreadpool ON )
213
+ set (_default_executorch_build_cpuinfo ON )
214
+ endif ()
215
+ define_overridable_option(
216
+ EXECUTORCH_BUILD_PTHREADPOOL
217
+ "Build pthreadpool library."
218
+ BOOL ${_default_executorch_build_pthreadpool}
219
+ )
220
+ define_overridable_option(
221
+ EXECUTORCH_BUILD_CPUINFO
222
+ "Build cpuinfo library."
223
+ BOOL ${_default_executorch_build_cpuinfo}
224
+ )
225
+
208
226
# MARK: - Validations
209
227
# At this point all the options should be configured with their final value.
210
228
@@ -232,3 +250,12 @@ if(EXECUTORCH_ENABLE_EVENT_TRACER)
232
250
message (FATAL_ERROR "Use of 'EXECUTORCH_ENABLE_EVENT_TRACER' requires 'EXECUTORCH_BUILD_DEVTOOLS' to be enabled." )
233
251
endif ()
234
252
endif ()
253
+
254
+
255
+ if (EXECUTORCH_BUILD_ARM_BAREMETAL)
256
+ if (EXECUTORCH_BUILD_PTHREADPOOL)
257
+ message (FATAL_ERROR "Cannot enable both EXECUTORCH_BUILD_PTHREADPOOL and EXECUTORCH_BUILD_ARM_BAREMETAL" )
258
+ elseif (EXECUTORCH_BUILD_CPUINFO)
259
+ message (FATAL_ERROR "Cannot enable both EXECUTORCH_BUILD_CPUINFO and EXECUTORCH_BUILD_ARM_BAREMETAL" )
260
+ endif ()
261
+ endif ()
You can’t perform that action at this time.
0 commit comments