@@ -218,14 +218,14 @@ for preset_index in "${!PRESETS[@]}"; do
218218 # Do NOT add options here. Update the respective presets instead.
219219 cmake -S " ${SOURCE_ROOT_DIR} " \
220220 -B " ${preset_output_dir} " \
221+ --fresh \
221222 -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY=" ${preset_output_dir} " \
222223 -DCMAKE_BUILD_TYPE=" ${mode} " \
223224 ${CMAKE_OPTIONS_OVERRIDE[@]:- } \
224225 --preset " ${preset} "
225226
226227 cmake --build " ${preset_output_dir} " \
227- --config " ${mode} " \
228- -j$( sysctl -n hw.ncpu)
228+ --config " ${mode} "
229229 done
230230done
231231
@@ -238,7 +238,7 @@ mkdir -p "$FRAMEWORK_EXECUTORCH_HEADERS_PATH/$FRAMEWORK_EXECUTORCH_MODULE_NAME"
238238" $SOURCE_ROOT_DIR " /scripts/print_exported_headers.py --buck2=$( realpath " $BUCK2 " ) --targets \
239239 //extension/module: \
240240 //extension/tensor: \
241- rsync -av --files-from=- " $SOURCE_ROOT_DIR " " $HEADERS_ABSOLUTE_PATH /executorch "
241+ | rsync -av --files-from=- " $SOURCE_ROOT_DIR " " $FRAMEWORK_EXECUTORCH_HEADERS_PATH / $FRAMEWORK_EXECUTORCH_MODULE_NAME "
242242
243243# HACK: XCFrameworks don't appear to support exporting any build
244244# options, but we need the following:
@@ -248,18 +248,31 @@ mkdir -p "$FRAMEWORK_EXECUTORCH_HEADERS_PATH/$FRAMEWORK_EXECUTORCH_MODULE_NAME"
248248sed -i ' ' ' 1i\
249249#define C10_USING_CUSTOM_GENERATED_MACROS
250250' \
251- " $HEADERS_ABSOLUTE_PATH /executorch/runtime/core/portable_type/c10/c10/macros/Macros.h" \
252- " $HEADERS_ABSOLUTE_PATH /executorch/runtime/core/portable_type/c10/c10/macros/Export.h" \
253- " $HEADERS_ABSOLUTE_PATH /executorch/runtime/core/portable_type/c10/torch/standalone /macros/Export.h"
251+ " $FRAMEWORK_EXECUTORCH_HEADERS_PATH /executorch/runtime/core/portable_type/c10/c10/macros/Macros.h" \
252+ " $FRAMEWORK_EXECUTORCH_HEADERS_PATH /executorch/runtime/core/portable_type/c10/c10/macros/Export.h" \
253+ " $FRAMEWORK_EXECUTORCH_HEADERS_PATH /executorch/runtime/core/portable_type/c10/torch/headeronly /macros/Export.h"
254254
255255cp -r $FRAMEWORK_EXECUTORCH_HEADERS_PATH /executorch/runtime/core/portable_type/c10/c10 " $FRAMEWORK_EXECUTORCH_HEADERS_PATH /"
256256cp -r $FRAMEWORK_EXECUTORCH_HEADERS_PATH /executorch/runtime/core/portable_type/c10/torch " $FRAMEWORK_EXECUTORCH_HEADERS_PATH /"
257257
258258cp " $SOURCE_ROOT_DIR /extension/apple/$FRAMEWORK_EXECUTORCH_MODULE_NAME /Exported/" * .h " $FRAMEWORK_EXECUTORCH_HEADERS_PATH /$FRAMEWORK_EXECUTORCH_MODULE_NAME "
259259
260- cat > " $HEADERS_ABSOLUTE_PATH /module.modulemap" << 'EOF '
261- module ExecuTorch {
262- umbrella header "ExecuTorch/ExecuTorch.h"
260+ cat > " $FRAMEWORK_EXECUTORCH_HEADERS_PATH /module.modulemap" << EOF
261+ module ${FRAMEWORK_EXECUTORCH_MODULE_NAME} {
262+ umbrella header "${FRAMEWORK_EXECUTORCH_MODULE_NAME} /${FRAMEWORK_EXECUTORCH_MODULE_NAME} .h"
263+ export *
264+ }
265+ EOF
266+
267+ # FRAMEWORK_EXECUTORCH_LLM
268+
269+ mkdir -p " $FRAMEWORK_EXECUTORCH_LLM_HEADERS_PATH /$FRAMEWORK_EXECUTORCH_LLM_MODULE_NAME "
270+
271+ cp " $SOURCE_ROOT_DIR /extension/llm/apple/$FRAMEWORK_EXECUTORCH_LLM_MODULE_NAME /Exported/" * .h " $FRAMEWORK_EXECUTORCH_LLM_HEADERS_PATH /$FRAMEWORK_EXECUTORCH_LLM_MODULE_NAME "
272+
273+ cat > " $FRAMEWORK_EXECUTORCH_LLM_HEADERS_PATH /$FRAMEWORK_EXECUTORCH_LLM_MODULE_NAME /module.modulemap" << EOF
274+ module ${FRAMEWORK_EXECUTORCH_LLM_MODULE_NAME} {
275+ umbrella header "${FRAMEWORK_EXECUTORCH_LLM_MODULE_NAME} .h"
263276 export *
264277}
265278EOF
0 commit comments