@@ -18,7 +18,7 @@ def call_symbol_check(cc: list[str], source, executable, options):
1818 # See the definitions for ac_link in autoconf's lib/autoconf/c.m4 file for
1919 # reference.
2020 env_flags : list [str ] = []
21- for var in ['CFLAGS ' , 'CPPFLAGS' , 'LDFLAGS' ]:
21+ for var in ['CXXFLAGS ' , 'CPPFLAGS' , 'LDFLAGS' ]:
2222 env_flags += filter (None , os .environ .get (var , '' ).split (' ' ))
2323
2424 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):
2929
3030class TestSymbolChecks (unittest .TestCase ):
3131 def test_ELF (self ):
32- source = 'test1.c '
32+ source = 'test1.cpp '
3333 executable = 'test1'
34- cc = determine_wellknown_cmd ('CC ' , 'gcc ' )
34+ cc = determine_wellknown_cmd ('CXX ' , 'g++ ' )
3535
3636 # -lutil is part of the libc6 package so a safe bet that it's installed
3737 # 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 '
3939 executable = 'test2'
4040 with open (source , 'w' , encoding = "utf8" ) as f :
4141 f .write ('''
@@ -53,7 +53,7 @@ def test_ELF(self):
5353 executable + ': failed LIBRARY_DEPENDENCIES' ))
5454
5555 # finally, check a simple conforming binary
56- source = 'test3.c '
56+ source = 'test3.cpp '
5757 executable = 'test3'
5858 with open (source , 'w' , encoding = "utf8" ) as f :
5959 f .write ('''
@@ -70,9 +70,9 @@ def test_ELF(self):
7070 (0 , '' ))
7171
7272 def test_MACHO (self ):
73- source = 'test1.c '
73+ source = 'test1.cpp '
7474 executable = 'test1'
75- cc = determine_wellknown_cmd ('CC ' , 'clang' )
75+ cc = determine_wellknown_cmd ('CXX ' , 'clang++ ' )
7676
7777 with open (source , 'w' , encoding = "utf8" ) as f :
7878 f .write ('''
@@ -90,7 +90,7 @@ def test_MACHO(self):
9090 (1 , 'libexpat.1.dylib is not in ALLOWED_LIBRARIES!\n ' +
9191 f'{ executable } : failed DYNAMIC_LIBRARIES MIN_OS SDK' ))
9292
93- source = 'test2.c '
93+ source = 'test2.cpp '
9494 executable = 'test2'
9595 with open (source , 'w' , encoding = "utf8" ) as f :
9696 f .write ('''
@@ -106,7 +106,7 @@ def test_MACHO(self):
106106 self .assertEqual (call_symbol_check (cc , source , executable , ['-framework' , 'CoreGraphics' , '-Wl,-platform_version' ,'-Wl,macos' , '-Wl,11.4' , '-Wl,11.4' ]),
107107 (1 , f'{ executable } : failed MIN_OS SDK' ))
108108
109- source = 'test3.c '
109+ source = 'test3.cpp '
110110 executable = 'test3'
111111 with open (source , 'w' , encoding = "utf8" ) as f :
112112 f .write ('''
@@ -120,9 +120,9 @@ def test_MACHO(self):
120120 (1 , f'{ executable } : failed SDK' ))
121121
122122 def test_PE (self ):
123- source = 'test1.c '
123+ source = 'test1.cpp '
124124 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++ ' )
126126
127127 with open (source , 'w' , encoding = "utf8" ) as f :
128128 f .write ('''
@@ -139,7 +139,7 @@ def test_PE(self):
139139 (1 , 'pdh.dll is not in ALLOWED_LIBRARIES!\n ' +
140140 executable + ': failed DYNAMIC_LIBRARIES' ))
141141
142- source = 'test2.c '
142+ source = 'test2.cpp '
143143 executable = 'test2.exe'
144144
145145 with open (source , 'w' , encoding = "utf8" ) as f :
@@ -153,7 +153,7 @@ def test_PE(self):
153153 self .assertEqual (call_symbol_check (cc , source , executable , ['-Wl,--major-subsystem-version' , '-Wl,9' , '-Wl,--minor-subsystem-version' , '-Wl,9' ]),
154154 (1 , executable + ': failed SUBSYSTEM_VERSION' ))
155155
156- source = 'test3.c '
156+ source = 'test3.cpp '
157157 executable = 'test3.exe'
158158 with open (source , 'w' , encoding = "utf8" ) as f :
159159 f .write ('''
0 commit comments