Is it possible to build SDL2 in 32-bit for OSX 10.12.6?

I’m attempting to build Xash3D on Max, which utilises SDL2. Unfortunately, due to limitations it wouldn’t be worth my time to fix right now, the engine doesn’t work in 64-bit and must be built in 32-bit.

I’ve been able to run a 32-bit Xash3D build successfully on Windows, but when building on Mac I get issues linking to my compiled SDL2 libraries because they’re not the right architecture. I’ve tried passing the same arguments to SDL2’s cmake call as I do to Xash3d - namely -DCMAKE_C_FLAGS="-m32" -DCMAKE_CXX_FLAGS="-m32" -DCMAKE_EXE_LINKER_FLAGS="-m32" - but this doesn’t seem to have any effect. I have seen one other article floating around on the internet about 32-bit SDL Mac builds, but it looks like it’s for pre-SDL2 and I’m not sure whether the same process still applies. It also implies that the recent binaries are “universal” and should work for either architecture, but this has not been my experience (I may just not know enough about how compiling for Mac works).

Is a 32-bit SDL2 Mac build possible, and if so, is there a recommended way of doing it?

By using .configure I am able to build SDL2 in 32bit.

OPT=’ -arch i386 -m32 -O2 -msse -msse2’
SDK=’ -mmacosx-version-min=10.7 '
export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
export CC="/usr/bin/clang -arch i386"
export CXX="/usr/bin/clang++ -arch i386"
export PKG_CONFIG=

Thanks, this did seem to work. I’ll make a note of it!