File tree Expand file tree Collapse file tree 3 files changed +50
-3
lines changed Expand file tree Collapse file tree 3 files changed +50
-3
lines changed Original file line number Diff line number Diff line change 4444
4545cmake_minimum_required (VERSION 3.24)
4646project (executorch)
47+
48+ # MARK: - Start EXECUTORCH_H12025_BUILD_MIGRATION --------------------------------------------------
49+
50+ include (${PROJECT_SOURCE_DIR} /tools/cmake/common/preset.cmake)
51+ include (${PROJECT_SOURCE_DIR} /tools/cmake/preset/default.cmake)
52+
53+ # MARK: - End EXECUTORCH_H12025_BUILD_MIGRATION ----------------------------------------------------
54+
4755include (tools/cmake/Utils.cmake)
4856include (CMakeDependentOption)
4957
@@ -96,9 +104,6 @@ set(EXECUTORCH_PAL_DEFAULT
96104 "Which PAL default implementation to use: one of {posix, minimal}"
97105)
98106
99- option (EXECUTORCH_ENABLE_LOGGING "Build with ET_LOG_ENABLED"
100- ${_default_release_disabled_options}
101- )
102107if (NOT EXECUTORCH_ENABLE_LOGGING)
103108 # Avoid pulling in the logging strings, which can be large. Note that this
104109 # will set the compiler flag for all targets in this directory, and for all
Original file line number Diff line number Diff line change 1+ # Copyright (c) Meta Platforms, Inc. and affiliates.
2+ # All rights reserved.
3+ #
4+ # This source code is licensed under the BSD-style license found in the
5+ # LICENSE file in the root directory of this source tree.
6+
7+ # Enforce config names to always start with EXECUTORCH_, else raise an error.
8+ function (enforce_executorch_config_name NAME )
9+ if (NOT "${NAME} " MATCHES "^EXECUTORCH_" )
10+ message (FATAL_ERROR "Config name '${NAME} ' must start with EXECUTORCH_" )
11+ endif ()
12+ endfunction ()
13+
14+ # Define an overridable config.
15+ # 1) If the config is already defined in the process, then store that in cache
16+ # 2) If the config is NOT set, then store the default value in cache
17+ macro (define_overridable_config NAME DESCRIPTION DEFAULT_VALUE)
18+ enforce_executorch_config_name(${NAME} )
19+
20+ if (DEFINED ${NAME} )
21+ set (${NAME} ${${NAME} } CACHE STRING ${DESCRIPTION} FORCE)
22+ else ()
23+ set (${NAME} ${DEFAULT_VALUE} CACHE STRING ${DESCRIPTION} )
24+ endif ()
25+ endmacro ()
Original file line number Diff line number Diff line change 1+ # Copyright (c) Meta Platforms, Inc. and affiliates.
2+ # All rights reserved.
3+ #
4+ # This source code is licensed under the BSD-style license found in the
5+ # LICENSE file in the root directory of this source tree.
6+
7+ if (CMAKE_BUILD_TYPE STREQUAL "Release" )
8+ set (_is_build_type_release ON )
9+ set (_is_build_type_debug OFF )
10+ else ()
11+ set (_is_build_type_release OFF )
12+ set (_is_build_type_debug ON )
13+ endif ()
14+
15+ # MARK: - Definitions
16+
17+ define_overridable_config(EXECUTORCH_ENABLE_LOGGING "Build with ET_LOG_ENABLED" ${_is_build_type_debug} )
You can’t perform that action at this time.
0 commit comments