File tree Expand file tree Collapse file tree 1 file changed +9
-10
lines changed
Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change 77import platform
88import sysconfig
99
10+ from setuptools_dso .probe import ProbeToolchain
11+
12+
1013__all__ = (
1114 'get_config_var' ,
1215 'get_config_vars' ,
@@ -25,19 +28,15 @@ def _makeconf():
2528 }[platform .system ()]
2629
2730 # select epics CMPLR_CLASS
28- CC = sysconfig .get_config_var ('CC' )
29- if CC is None and osname == 'WIN32' :
30- cmplrname = conf ['CMPLR_CLASS' ] = 'msvc'
31- elif CC is None :
32- raise RuntimeError ("Unable to determine compiler" )
33- elif CC .find ('gcc' )!= - 1 :
34- cmplrname = conf ['CMPLR_CLASS' ] = 'gcc'
35- elif CC .find ('clang' )!= - 1 :
31+ ID = ProbeToolchain ().eval_macros (('__GNUC__' , '__clang__' , '_MSC_VER' ))
32+ if ID ['__clang__' ]:
3633 cmplrname = conf ['CMPLR_CLASS' ] = 'clang'
37- elif CC is None or CC .find ('cl' )!= - 1 :
34+ elif ID ['__GNUC__' ]:
35+ cmplrname = conf ['CMPLR_CLASS' ] = 'gcc'
36+ elif ID ['_MSC_VER' ]:
3837 cmplrname = conf ['CMPLR_CLASS' ] = 'msvc'
3938 else :
40- raise RuntimeError (" Unable to identify compiler %s" % CC )
39+ raise RuntimeError (' Unable to identify compiler %s' % ID )
4140
4241 machine = platform .machine ().lower () # host CPU, may not reflect target bit width on windows
4342 bits = {
You can’t perform that action at this time.
0 commit comments