From e2c7ba05b8ad8a0eb7991b0dca2c9381144416e9 Mon Sep 17 00:00:00 2001 From: Antoni Sawicki Date: Sun, 5 Apr 2026 20:05:31 -0700 Subject: [PATCH] Fix CXXLUA CFLAGS conflict with C23 on macOS When CXXLUA is enabled, the C standard flag -std=gnu23 was being passed to C++ compilation via -x c++, causing build failures. Override CFLAGS instead of appending to avoid inheriting the C standard flag. --- lib-src/lua/Makefile.am | 2 +- tools/Makefile.am | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib-src/lua/Makefile.am b/lib-src/lua/Makefile.am index 48e0af32c..6b064d8f0 100644 --- a/lib-src/lua/Makefile.am +++ b/lib-src/lua/Makefile.am @@ -25,5 +25,5 @@ liblua_a_CFLAGS += -DLUA_USE_LINUX endif if CXXLUA -liblua_a_CFLAGS += -x c++ $(AM_CXXFLAGS) $(CXXFLAGS) +liblua_a_CFLAGS = -x c++ $(AM_CXXFLAGS) $(CXXFLAGS) endif diff --git a/tools/Makefile.am b/tools/Makefile.am index 226781223..e04a8b774 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -21,5 +21,5 @@ tolua_CFLAGS = -I$(top_srcdir)/lib-src/lua $(AM_CFLAGS) tolua_LDADD = $(top_builddir)/lib-src/lua/liblua.a $(AM_LDADD) if CXXLUA -tolua_CFLAGS += -x c++ $(AM_CXXFLAGS) $(CXXFLAGS) +tolua_CFLAGS = -I$(top_srcdir)/lib-src/lua -x c++ $(AM_CXXFLAGS) $(CXXFLAGS) endif