From 2c99607d3d818ec6bfc6b1e42c64ce1cdda3777a Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 10 May 2022 16:46:48 +0300 Subject: [PATCH] Pass "-pthread" flag to GoogleTest only on Unix OS --- platformio/test/runners/googletest.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/platformio/test/runners/googletest.py b/platformio/test/runners/googletest.py index 69df370c..612a7943 100644 --- a/platformio/test/runners/googletest.py +++ b/platformio/test/runners/googletest.py @@ -17,6 +17,7 @@ import re import click +from platformio.compat import IS_WINDOWS from platformio.test.result import TestCase, TestCaseSource, TestStatus from platformio.test.runners.base import TestRunnerBase @@ -100,7 +101,9 @@ class GoogletestTestRunner(TestRunnerBase): def configure_build_env(self, env): if self.platform.is_embedded(): return - env.Append(CXXFLAGS=["-std=c++11", "-pthread"]) + env.Append(CXXFLAGS=["-std=c++11"]) + if not IS_WINDOWS: + env.Append(CCFLAGS=["-pthread"]) def on_testing_line_output(self, line): if self.options.verbose: