@@ -18,7 +18,7 @@ def call_symbol_check(cc: list[str], source, executable, options):
18
18
# See the definitions for ac_link in autoconf's lib/autoconf/c.m4 file for
19
19
# reference.
20
20
env_flags : list [str ] = []
21
- for var in ['CFLAGS ' , 'CPPFLAGS' , 'LDFLAGS' ]:
21
+ for var in ['CXXFLAGS ' , 'CPPFLAGS' , 'LDFLAGS' ]:
22
22
env_flags += filter (None , os .environ .get (var , '' ).split (' ' ))
23
23
24
24
subprocess .run ([* cc ,source ,'-o' ,executable ] + env_flags + options , check = True )
@@ -29,13 +29,13 @@ def call_symbol_check(cc: list[str], source, executable, options):
29
29
30
30
class TestSymbolChecks (unittest .TestCase ):
31
31
def test_ELF (self ):
32
- source = 'test1.c '
32
+ source = 'test1.cpp '
33
33
executable = 'test1'
34
- cc = determine_wellknown_cmd ('CC ' , 'gcc ' )
34
+ cc = determine_wellknown_cmd ('CXX ' , 'g++ ' )
35
35
36
36
# -lutil is part of the libc6 package so a safe bet that it's installed
37
37
# it's also out of context enough that it's unlikely to ever become a real dependency
38
- source = 'test2.c '
38
+ source = 'test2.cpp '
39
39
executable = 'test2'
40
40
with open (source , 'w' , encoding = "utf8" ) as f :
41
41
f .write ('''
@@ -53,7 +53,7 @@ def test_ELF(self):
53
53
executable + ': failed LIBRARY_DEPENDENCIES' ))
54
54
55
55
# finally, check a simple conforming binary
56
- source = 'test3.c '
56
+ source = 'test3.cpp '
57
57
executable = 'test3'
58
58
with open (source , 'w' , encoding = "utf8" ) as f :
59
59
f .write ('''
@@ -70,9 +70,9 @@ def test_ELF(self):
70
70
(0 , '' ))
71
71
72
72
def test_MACHO (self ):
73
- source = 'test1.c '
73
+ source = 'test1.cpp '
74
74
executable = 'test1'
75
- cc = determine_wellknown_cmd ('CC ' , 'clang' )
75
+ cc = determine_wellknown_cmd ('CXX ' , 'clang++ ' )
76
76
77
77
with open (source , 'w' , encoding = "utf8" ) as f :
78
78
f .write ('''
@@ -90,7 +90,7 @@ def test_MACHO(self):
90
90
(1 , 'libexpat.1.dylib is not in ALLOWED_LIBRARIES!\n ' +
91
91
f'{ executable } : failed DYNAMIC_LIBRARIES MIN_OS SDK' ))
92
92
93
- source = 'test2.c '
93
+ source = 'test2.cpp '
94
94
executable = 'test2'
95
95
with open (source , 'w' , encoding = "utf8" ) as f :
96
96
f .write ('''
@@ -106,7 +106,7 @@ def test_MACHO(self):
106
106
self .assertEqual (call_symbol_check (cc , source , executable , ['-framework' , 'CoreGraphics' , '-Wl,-platform_version' ,'-Wl,macos' , '-Wl,11.4' , '-Wl,11.4' ]),
107
107
(1 , f'{ executable } : failed MIN_OS SDK' ))
108
108
109
- source = 'test3.c '
109
+ source = 'test3.cpp '
110
110
executable = 'test3'
111
111
with open (source , 'w' , encoding = "utf8" ) as f :
112
112
f .write ('''
@@ -120,9 +120,9 @@ def test_MACHO(self):
120
120
(1 , f'{ executable } : failed SDK' ))
121
121
122
122
def test_PE (self ):
123
- source = 'test1.c '
123
+ source = 'test1.cpp '
124
124
executable = 'test1.exe'
125
- cc = determine_wellknown_cmd ('CC ' , 'x86_64-w64-mingw32-gcc ' )
125
+ cc = determine_wellknown_cmd ('CXX ' , 'x86_64-w64-mingw32-g++ ' )
126
126
127
127
with open (source , 'w' , encoding = "utf8" ) as f :
128
128
f .write ('''
@@ -139,7 +139,7 @@ def test_PE(self):
139
139
(1 , 'pdh.dll is not in ALLOWED_LIBRARIES!\n ' +
140
140
executable + ': failed DYNAMIC_LIBRARIES' ))
141
141
142
- source = 'test2.c '
142
+ source = 'test2.cpp '
143
143
executable = 'test2.exe'
144
144
145
145
with open (source , 'w' , encoding = "utf8" ) as f :
@@ -153,7 +153,7 @@ def test_PE(self):
153
153
self .assertEqual (call_symbol_check (cc , source , executable , ['-Wl,--major-subsystem-version' , '-Wl,9' , '-Wl,--minor-subsystem-version' , '-Wl,9' ]),
154
154
(1 , executable + ': failed SUBSYSTEM_VERSION' ))
155
155
156
- source = 'test3.c '
156
+ source = 'test3.cpp '
157
157
executable = 'test3.exe'
158
158
with open (source , 'w' , encoding = "utf8" ) as f :
159
159
f .write ('''
0 commit comments