13
0

Add defines necessary for successful gcc/mingw compile with --cxx11 option

_USE_MATH_DEFINES is required for M_PI

WIN32 is no longer defined by gcc/mingw with --cxx11 option enabled(of course
_WIN32 still is) but as it is used in a liblo header(even though it is probably
incorrect to do so) define it.
This commit is contained in:
Tim Mayberry 2015-12-15 14:56:54 +10:00
parent 5643ed4257
commit e297e27b7f

View File

@ -999,6 +999,11 @@ int main () { int x = SFC_RF64_AUTO_DOWNGRADE; return 0; }
conf.env.append_value('CFLAGS', '-DCOMPILER_MINGW') conf.env.append_value('CFLAGS', '-DCOMPILER_MINGW')
conf.env.append_value('CXXFLAGS', '-DPLATFORM_WINDOWS') conf.env.append_value('CXXFLAGS', '-DPLATFORM_WINDOWS')
conf.env.append_value('CXXFLAGS', '-DCOMPILER_MINGW') conf.env.append_value('CXXFLAGS', '-DCOMPILER_MINGW')
if conf.options.cxx11:
conf.env.append_value('CFLAGS', '-D_USE_MATH_DEFINES')
conf.env.append_value('CXXFLAGS', '-D_USE_MATH_DEFINES')
conf.env.append_value('CFLAGS', '-DWIN32')
conf.env.append_value('CXXFLAGS', '-DWIN32')
conf.env.append_value('LIB', 'pthread') conf.env.append_value('LIB', 'pthread')
# needed for at least libsmf # needed for at least libsmf
conf.check_cc(function_name='htonl', header_name='winsock2.h', lib='ws2_32') conf.check_cc(function_name='htonl', header_name='winsock2.h', lib='ws2_32')