@@ -101,14 +101,19 @@ def __init__(self, verbose=0, dry_run=0, force=0):
101
101
self .cxx = os .environ .get ('CXX' , 'g++' )
102
102
103
103
self .linker_dll = self .cc
104
+ self .linker_dll_cxx = self .cxx
104
105
shared_option = "-shared"
105
106
106
107
self .set_executables (
107
108
compiler = '%s -mcygwin -O -Wall' % self .cc ,
108
109
compiler_so = '%s -mcygwin -mdll -O -Wall' % self .cc ,
109
110
compiler_cxx = '%s -mcygwin -O -Wall' % self .cxx ,
111
+ compiler_so_cxx = '%s -mcygwin -mdll -O -Wall' % self .cxx ,
110
112
linker_exe = '%s -mcygwin' % self .cc ,
111
113
linker_so = ('{} -mcygwin {}' .format (self .linker_dll , shared_option )),
114
+ linker_exe_cxx = '%s -mcygwin' % self .cxx ,
115
+ linker_so_cxx = ('%s -mcygwin %s' %
116
+ (self .linker_dll_cxx , shared_option )),
112
117
)
113
118
114
119
# Include the appropriate MSVC runtime library if Python was built
@@ -140,9 +145,12 @@ def _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts):
140
145
raise CompileError (msg )
141
146
else : # for other files use the C-compiler
142
147
try :
143
- self .spawn (
144
- self .compiler_so + cc_args + [src , '-o' , obj ] + extra_postargs
145
- )
148
+ if self .detect_language (src ) == 'c++' :
149
+ self .spawn (self .compiler_so_cxx + cc_args + [src , '-o' , obj ] +
150
+ extra_postargs )
151
+ else :
152
+ self .spawn (
153
+ self .compiler_so + cc_args + [src , '-o' , obj ] + extra_postargs )
146
154
except DistutilsExecError as msg :
147
155
raise CompileError (msg )
148
156
@@ -278,9 +286,12 @@ def __init__(self, verbose=0, dry_run=0, force=0):
278
286
self .set_executables (
279
287
compiler = '%s -O -Wall' % self .cc ,
280
288
compiler_so = '%s -mdll -O -Wall' % self .cc ,
289
+ compiler_so_cxx = '%s -mdll -O -Wall' % self .cxx ,
281
290
compiler_cxx = '%s -O -Wall' % self .cxx ,
282
291
linker_exe = '%s' % self .cc ,
283
292
linker_so = '{} {}' .format (self .linker_dll , shared_option ),
293
+ linker_exe_cxx = '%s' % self .cxx ,
294
+ linker_so_cxx = '%s %s' % (self .linker_dll_cxx , shared_option )
284
295
)
285
296
286
297
def runtime_library_dir_option (self , dir ):
0 commit comments