diff --git a/scripts/setup.sh b/scripts/setup.sh index 6c32285..13dfe70 100644 --- a/scripts/setup.sh +++ b/scripts/setup.sh @@ -276,10 +276,15 @@ for f in $(find src -type f -name "*.cpp"); do grep -q "" "$f" || sed -i '1i #include ' "$f" done -# Build Example (Force C++17 for better compatibility with this addon) +# Build Example cd "$REAL_HOME/openFrameworks/addons/ofxPiMapper/example_basic" -echo "Starting compilation (Forcing C++17)..." -sudo -u "$REAL_USER" make -j1 USER_CFLAGS="-Wno-error -std=c++17" USER_CPPFLAGS="-std=c++17" +echo "Cleaning old objects to ensure consistent symbol generation..." +sudo -u "$REAL_USER" make clean + +echo "Starting compilation (Global Flags)..." +# Using PLATFORM_CFLAGS ensures these flags propagate to the addon source as well +GLOBAL_FLAGS="-Wno-error -Wno-reorder -Wno-sign-compare -Wno-delete-non-virtual-dtor -std=c++17" +sudo -u "$REAL_USER" make -j1 PLATFORM_CFLAGS="$GLOBAL_FLAGS" USER_CFLAGS="$GLOBAL_FLAGS" USER_CPPFLAGS="-std=c++17" cp bin/example_basic /usr/local/bin/ofxPiMapper chmod +x /usr/local/bin/ofxPiMapper