Skip to content

Commit 91aee3b

Browse files
committed
✨ Simplify build config by integrating data loader and baremetal exclusions.
1 parent 611092d commit 91aee3b

File tree

2 files changed

+16
-20
lines changed

2 files changed

+16
-20
lines changed

CMakeLists.txt

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -522,17 +522,6 @@ if(EXECUTORCH_BUILD_CORTEX_M)
522522
endif()
523523

524524
if(EXECUTORCH_BUILD_DEVTOOLS)
525-
if(NOT EXECUTORCH_BUILD_ARM_BAREMETAL)
526-
set(EXECUTORCH_BUILD_EXTENSION_DATA_LOADER
527-
ON
528-
CACHE BOOL "EXECUTORCH_BUILD_EXTENSION_DATA_LOADER" FORCE
529-
)
530-
else()
531-
set(EXECUTORCH_BUILD_EXTENSION_DATA_LOADER
532-
OFF
533-
CACHE BOOL "EXECUTORCH_BUILD_EXTENSION_DATA_LOADER" FORCE
534-
)
535-
endif()
536525
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/devtools)
537526
endif()
538527

tools/cmake/preset/default.cmake

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,13 @@ check_required_options_on(
295295
EXECUTORCH_BUILD_DEVTOOLS
296296
)
297297

298+
check_required_options_on(
299+
IF_ON
300+
EXECUTORCH_BUILD_DEVTOOLS
301+
REQUIRES
302+
EXECUTORCH_BUILD_EXTENSION_DATA_LOADER
303+
)
304+
298305
check_required_options_on(
299306
IF_ON
300307
EXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR
@@ -342,6 +349,15 @@ check_required_options_on(
342349
EXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR
343350
)
344351

352+
check_conflicting_options_on(
353+
IF_ON
354+
EXECUTORCH_BUILD_ARM_BAREMETAL
355+
CONFLICTS_WITH
356+
EXECUTORCH_BUILD_EXTENSION_DATA_LOADER
357+
EXECUTORCH_BUILD_PTHREADPOOL
358+
EXECUTORCH_BUILD_CPUINFO
359+
)
360+
345361

346362
if(NOT EXISTS ${EXECUTORCH_PAL_DEFAULT_FILE_PATH})
347363
message(FATAL_ERROR "PAL default implementation (EXECUTORCH_PAL_DEFAULT=${EXECUTORCH_PAL_DEFAULT}) file not found: ${EXECUTORCH_PAL_DEFAULT_FILE_PATH}. Choices: posix, minimal, android")
@@ -360,12 +376,3 @@ elseif(_executorch_log_level_lower STREQUAL "fatal")
360376
else()
361377
message(FATAL_ERROR "Unknown EXECUTORCH_LOG_LEVEL '${EXECUTORCH_LOG_LEVEL}'. Choices: Debug, Info, Error, Fatal")
362378
endif()
363-
364-
365-
if(EXECUTORCH_BUILD_ARM_BAREMETAL)
366-
if(EXECUTORCH_BUILD_PTHREADPOOL)
367-
message(FATAL_ERROR "Cannot enable both EXECUTORCH_BUILD_PTHREADPOOL and EXECUTORCH_BUILD_ARM_BAREMETAL")
368-
elseif(EXECUTORCH_BUILD_CPUINFO)
369-
message(FATAL_ERROR "Cannot enable both EXECUTORCH_BUILD_CPUINFO and EXECUTORCH_BUILD_ARM_BAREMETAL")
370-
endif()
371-
endif()

0 commit comments

Comments
 (0)