File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -188,7 +188,7 @@ echo "Exporting headers"
188188mkdir -p " $HEADERS_PATH "
189189
190190# Set BUCK2 to the path of the buck2 executable in $OUTPUT/*/buck2-bin/buck2-*
191- BUCK2=$( find . -type f -path ' */buck2-bin/buck2-*' | head -n 1)
191+ BUCK2=$( find $SOURCE_ROOT_DIR -type f -path ' */buck2-bin/buck2-*' | head -n 1)
192192if [[ -z " $BUCK2 " ]]; then
193193 echo " Could not find buck2 executable in any buck2-bin directory under $OUTPUT "
194194 BUCK2=$( which buck2)
@@ -201,6 +201,20 @@ check_command "$BUCK2"
201201 //extension/tensor: \
202202| rsync -av --files-from=- " $SOURCE_ROOT_DIR " " $HEADERS_PATH /executorch"
203203
204+ # HACK: XCFrameworks don't appear to support exporting any build
205+ # options, but we need the following:
206+ # - runtime/core/portable/type/c10 reachable with `#include <c10/...>`
207+ # - exported -DC10_USING_CUSTOM_GENERATED_MACROS compiler flag
208+ # So, just patch our generated framework to do that.
209+ sed -i ' ' ' 1i\
210+ #define C10_USING_CUSTOM_GENERATED_MACROS
211+ ' $SOURCE_ROOT_DIR /runtime/core/portable_type/c10/macros/Macros.h
212+ sed -i ' ' ' 1i\
213+ #define C10_USING_CUSTOM_GENERATED_MACROS
214+ ' $SOURCE_ROOT_DIR /runtime/core/portable_type/c10/macros/Export.h
215+ cp -r $SOURCE_ROOT_DIR /runtime/core/portable_type/c10 " $HEADERS_PATH /"
216+
217+
204218cp " $SOURCE_ROOT_DIR /extension/apple/ExecuTorch/Exported/" * .h " $HEADERS_PATH /executorch"
205219cp " $SOURCE_ROOT_DIR /extension/apple/ExecuTorch/Exported/" * .modulemap " $HEADERS_PATH "
206220
You can’t perform that action at this time.
0 commit comments