theabolton / hexter

Yamaha DX7 modeling DSSI soft synth
http://dssi.sourceforge.net/hexter.html
GNU General Public License v2.0
113 stars 15 forks source link

Add check for whether compiler supports -finline-limit #6

Closed jamiebullock closed 6 years ago

jamiebullock commented 9 years ago

Hexter currently won't compile on OS X Yosemite, giving the error:

clang: error: unknown argument: '-finline-limit=5000'

This is because -finline-limit isn't supported clang 6. The pull request fixes this by testing whether the user's compiler supports -finline-limit. I don't know about other compilers, but it seems better to just test if the compiler on the host system supports the flag rather than a) have a conditional for every possible compiler permutation or b) have a conditional for the sytem like "Darwin" or similar

theabolton commented 6 years ago

Thanks, Jamie. I think the appropriate thing to do is not request advanced optimizations. Using flags like '-finline-limit' can often make things slower, depending on the code, compiler, and environmental factors like overall system cache pressure at time of execution. So I've stripped those out, leaving just the basic (and hopefully fairly portable) inlining and fast-math flags, and otherwise trusting the compiler. Users can always play with customizing the CFLAGS for their system, if they want.