Check for clang with an actual code check.
Turns out Apple in its infinite wisdom installs clang as /usr/bin/g++, so guessing based on executable name doesn't work.
This commit is contained in:
parent
ea5876b836
commit
a2475509e5
10
wscript
10
wscript
@ -148,7 +148,15 @@ def set_compiler_flags (conf,opt):
|
|||||||
version = u[2]
|
version = u[2]
|
||||||
|
|
||||||
# waf adds -O0 -g itself. thanks waf!
|
# waf adds -O0 -g itself. thanks waf!
|
||||||
is_clang = 'clang++' in conf.env['CXX'][0]
|
is_clang = conf.check_cxx(fragment = '''
|
||||||
|
#ifndef __clang__
|
||||||
|
#error
|
||||||
|
#endif
|
||||||
|
int main() { return 0; }''',
|
||||||
|
features = 'cxx',
|
||||||
|
mandatory = False,
|
||||||
|
execute = False,
|
||||||
|
msg = 'Checking for clang')
|
||||||
|
|
||||||
if conf.options.asan:
|
if conf.options.asan:
|
||||||
conf.check_cxx(cxxflags=["-fsanitize=address", "-fno-omit-frame-pointer"], linkflags=["-fsanitize=address"])
|
conf.check_cxx(cxxflags=["-fsanitize=address", "-fno-omit-frame-pointer"], linkflags=["-fsanitize=address"])
|
||||||
|
Loading…
Reference in New Issue
Block a user