]> granicus.if.org Git - graphviz/commitdiff
Use dynamic run-time library in test_1767
authorMagnus Jacobsson <magnus.jacobsson@berotec.se>
Thu, 13 Aug 2020 15:54:05 +0000 (17:54 +0200)
committerMagnus Jacobsson <magnus.jacobsson@berotec.se>
Tue, 18 Aug 2020 09:46:30 +0000 (11:46 +0200)
From
https://docs.microsoft.com/en-us/cpp/build/reference/md-mt-ld-use-run-time-library?view=vs-2019:

/MD
Causes the application to use the multithread-specific and
DLL-specific version of the run-time library.

Fixes https://gitlab.com/graphviz/graphviz/-/issues/1794

rtest/test_regression.py

index 2ef4f434a468061925465e1cd7843bdea1968eb9..b6d466f72d1376c0b34c082edad4ac20ffb20cab 100644 (file)
@@ -271,9 +271,11 @@ def test_1767():
 
     # compile our test code
     exe = os.path.join(tmp, 'a.exe')
+    rt_lib_option = '-MDd' if os.environ.get('configuration') == 'Debug' else '-MD'
+
     if platform.system() == 'Windows':
-        subprocess.check_call(['cl', c_src, '-Fe:', exe, '-nologo', '-link',
-          'cgraph.lib', 'gvc.lib'])
+        subprocess.check_call(['cl', c_src, '-Fe:', exe, '-nologo',
+          rt_lib_option, '-link', 'cgraph.lib', 'gvc.lib'])
     else:
         cc = os.environ.get('CC', 'cc')
         subprocess.check_call([cc, c_src, '-o', exe, '-lcgraph', '-lgvc'])