Post-process exported WebKit headers based on SDKROOT
Created attachment 219161 [details] Post-process exported WebKit headers based on SDKROOT
Here's a formatted version of the script: postProcessInDirectory() { cd "$1" shopt -s nocasematch; if [[ ${SDKROOT} =~ iphoneos ]]; then local unifdefOptions="-DTARGET_OS_EMBEDDED=1 -DTARGET_OS_IPHONE=1 -DTARGET_IPHONE_SIMULATOR=0"; elif [[ ${SDKROOT} =~ iphonesimulator ]]; then local unifdefOptions="-DTARGET_OS_EMBEDDED=0 -DTARGET_OS_IPHONE=1 -DTARGET_IPHONE_SIMULATOR=1"; else local unifdefOptions="-DTARGET_OS_EMBEDDED=0 -DTARGET_OS_IPHONE=0 -DTARGET_IPHONE_SIMULATOR=0"; fi for header in $(find . -name '*.h' -type f); do unifdef -B ${unifdefOptions} -o ${header}.unifdef ${header} case $? in 0) rm ${header}.unifdef ;; 1) mv ${header}{.unifdef,} ;; *) exit 1 ;; esac done } postProcessInDirectory "${TARGET_BUILD_DIR}/${PUBLIC_HEADERS_FOLDER_PATH}" postProcessInDirectory "${TARGET_BUILD_DIR}/${PRIVATE_HEADERS_FOLDER_PATH}"
(In reply to comment #2) > Here's a formatted version of the script: > > postProcessInDirectory() { > cd "$1" > > shopt -s nocasematch; > if [[ ${SDKROOT} =~ iphoneos ]]; then SDKROOT is a path which may contain arbitrary components, any of which may match “iphoneos”. Could we use PLATFORM_NAME here?
(In reply to comment #3) > (In reply to comment #2) > > Here's a formatted version of the script: > > > > postProcessInDirectory() { > > cd "$1" > > > > shopt -s nocasematch; > > if [[ ${SDKROOT} =~ iphoneos ]]; then > > SDKROOT is a path which may contain arbitrary components, any of which may match “iphoneos”. Could we use PLATFORM_NAME here? Good point. Yes, I can use PLATFORM_NAME instead.
Created attachment 219176 [details] Post-process exported WebKit headers based on PLATFORM_NAME
(In reply to comment #5) > Created an attachment (id=219176) [details] > Post-process exported WebKit headers based on PLATFORM_NAME Here's the updated script with formatting: postProcessInDirectory() { cd "$1" shopt -s nocasematch; if [[ ${PLATFORM_NAME} == iphoneos ]]; then local unifdefOptions="-DTARGET_OS_EMBEDDED=1 -DTARGET_OS_IPHONE=1 -DTARGET_IPHONE_SIMULATOR=0"; elif [[ ${PLATFORM_NAME} == iphonesimulator ]]; then local unifdefOptions="-DTARGET_OS_EMBEDDED=0 -DTARGET_OS_IPHONE=1 -DTARGET_IPHONE_SIMULATOR=1"; else local unifdefOptions="-DTARGET_OS_EMBEDDED=0 -DTARGET_OS_IPHONE=0 -DTARGET_IPHONE_SIMULATOR=0"; fi for header in $(find . -name '*.h' -type f); do unifdef -B ${unifdefOptions} -o ${header}.unifdef ${header} case $? in 0) rm ${header}.unifdef ;; 1) mv ${header}{.unifdef,} ;; *) exit 1 ;; esac done } postProcessInDirectory "${TARGET_BUILD_DIR}/${PUBLIC_HEADERS_FOLDER_PATH}" postProcessInDirectory "${TARGET_BUILD_DIR}/${PRIVATE_HEADERS_FOLDER_PATH}"
(In reply to comment #6) > (In reply to comment #5) > > Created an attachment (id=219176) [details] [details] > > Post-process exported WebKit headers based on PLATFORM_NAME > > Here's the updated script with formatting: > > shopt -s nocasematch; Oops. This line can be removed now.
Comment on attachment 219176 [details] Post-process exported WebKit headers based on PLATFORM_NAME r=me How long does this step take?
(In reply to comment #8) > (From update of attachment 219176 [details]) > r=me Thanks! > How long does this step take? When no headers require post-processing, the step takes ~1.2s. With a clean build in a tree containing the iOS port's modifications to WebKit headers, the step takes ~1.4s. This is on a Late 2012 13-inch MacBook Pro with Retina display.
Committed r160559: <http://trac.webkit.org/changeset/160559>