From 675c0954057b1121542e0d8d3bdaa71b0262e0e7 Mon Sep 17 00:00:00 2001 From: Mathieu Ropert Date: Tue, 13 Dec 2016 09:31:34 +0100 Subject: [PATCH] FreeBSD support, part 2 (#753) * FreeBSD minimal support * fixed tests for FreeBSD * Issue #742: Fix default compiler on FreeBSD. Add FreeBSD to default accepted os in unit tests. --- conans/client/detect.py | 7 ++++++- conans/test/model/other_settings_test.py | 2 +- conans/test/model/settings_test.py | 2 +- conans/test/update_settings_yml_test.py | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/conans/client/detect.py b/conans/client/detect.py index ecda37b23fb..59db08638cd 100644 --- a/conans/client/detect.py +++ b/conans/client/detect.py @@ -127,8 +127,13 @@ def _detect_compiler_version(result, output): result.append(("compiler.runtime", "MD")) elif compiler == "apple-clang": result.append(("compiler.libcxx", "libc++")) - elif compiler == "gcc" or "clang" in compiler: + elif compiler == "gcc" in compiler: result.append(("compiler.libcxx", "libstdc++")) + elif compiler == "clang" in compiler: + if platform.system() == "FreeBSD": + result.append(("compiler.libcxx", "libc++")) + else: + result.append(("compiler.libcxx", "libstdc++")) def detected_os(): diff --git a/conans/test/model/other_settings_test.py b/conans/test/model/other_settings_test.py index 4a9eea26a45..b96130244c2 100644 --- a/conans/test/model/other_settings_test.py +++ b/conans/test/model/other_settings_test.py @@ -93,7 +93,7 @@ def invalid_settings_test2(self): class SayConan(ConanFile): name = "Say" version = "0.1" - settings = {"os": ["Windows", "Linux", "Macos"], "compiler": ["Visual Studio"]} + settings = {"os": ["Windows", "Linux", "Macos", "FreeBSD"], "compiler": ["Visual Studio"]} """ self.client.save({CONANFILE: content}) diff --git a/conans/test/model/settings_test.py b/conans/test/model/settings_test.py index 564fecb0027..c8b9b51dbae 100644 --- a/conans/test/model/settings_test.py +++ b/conans/test/model/settings_test.py @@ -58,7 +58,7 @@ def remove_os_test(self): self.assertEqual(self.sut.os, "Linux") def loads_default_test(self): - settings = Settings.loads("""os: [Windows, Linux, Macos, Android] + settings = Settings.loads("""os: [Windows, Linux, Macos, Android, FreeBSD] arch: [x86, x86_64, arm] compiler: gcc: diff --git a/conans/test/update_settings_yml_test.py b/conans/test/update_settings_yml_test.py index a65f3e7eba7..8a072e5fac5 100644 --- a/conans/test/update_settings_yml_test.py +++ b/conans/test/update_settings_yml_test.py @@ -24,7 +24,7 @@ def build(self): self.output.warn("Building...") ''' prev_settings = """ -os: [Windows, Linux, Macos, Android] +os: [Windows, Linux, Macos, Android, FreeBSD] arch: [x86, x86_64, armv6, armv7, armv7hf, armv8] compiler: gcc: