diff --git a/scripts/build.sh b/scripts/build.sh index fe9e4ae..1e62581 100644 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -246,12 +246,20 @@ if [ -f "$ADDONS_MAKE" ]; then # Also include any libs/ bundled inside the addon (e.g. tinyxml in ofxXmlSettings) addon_libs="$OF_DIR/addons/$addon_name/libs" if [ -d "$addon_libs" ]; then + # Some addons (ofxXmlSettings) keep headers directly in libs/ (flat layout) + OF_EXTRA_INCLUDES="$OF_EXTRA_INCLUDES -I$addon_libs" for alib in "$addon_libs"/*/; do + [ -d "$alib" ] || continue + # libs//include/ layout (e.g. other addons) alib_inc="${alib}include" - [ -d "$alib_inc" ] || continue - while IFS= read -r subdir; do - OF_EXTRA_INCLUDES="$OF_EXTRA_INCLUDES -I$subdir" - done < <(find "$alib_inc" -type d) + if [ -d "$alib_inc" ]; then + while IFS= read -r subdir; do + OF_EXTRA_INCLUDES="$OF_EXTRA_INCLUDES -I$subdir" + done < <(find "$alib_inc" -type d) + else + # headers directly in libs// (no include/ subdir) + OF_EXTRA_INCLUDES="$OF_EXTRA_INCLUDES -I${alib%/}" + fi done fi done < "$ADDONS_MAKE"