From 558aa790f74f88e1905ec775c930b5fb3cd4c516 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Viana?= <57032457+vollous@users.noreply.github.com> Date: Thu, 16 May 2024 23:24:06 +0100 Subject: [PATCH] Conan: Different profiles for different clang versions. (#145) * Conan: Different profiles for different clang versions. * "get_gcc_version" -> "get_compiler_version" --------- Co-authored-by: Philipp Basler <28863303+phbasler@users.noreply.github.com> --- Setup.py | 31 +++++++++++++------- profiles/BSMPT/macos-debug-armv8-clang-13 | 8 +++++ profiles/BSMPT/macos-debug-armv8-clang-14 | 8 +++++ profiles/BSMPT/macos-debug-armv8-clang-15 | 8 +++++ profiles/BSMPT/macos-debug-x86_64-clang-13 | 8 +++++ profiles/BSMPT/macos-debug-x86_64-clang-14 | 8 +++++ profiles/BSMPT/macos-debug-x86_64-clang-15 | 8 +++++ profiles/BSMPT/macos-release-armv8-clang-13 | 8 +++++ profiles/BSMPT/macos-release-armv8-clang-14 | 8 +++++ profiles/BSMPT/macos-release-armv8-clang-15 | 8 +++++ profiles/BSMPT/macos-release-x86_64-clang-13 | 8 +++++ profiles/BSMPT/macos-release-x86_64-clang-14 | 8 +++++ profiles/BSMPT/macos-release-x86_64-clang-15 | 8 +++++ 13 files changed, 117 insertions(+), 10 deletions(-) create mode 100644 profiles/BSMPT/macos-debug-armv8-clang-13 create mode 100644 profiles/BSMPT/macos-debug-armv8-clang-14 create mode 100644 profiles/BSMPT/macos-debug-armv8-clang-15 create mode 100644 profiles/BSMPT/macos-debug-x86_64-clang-13 create mode 100644 profiles/BSMPT/macos-debug-x86_64-clang-14 create mode 100644 profiles/BSMPT/macos-debug-x86_64-clang-15 create mode 100644 profiles/BSMPT/macos-release-armv8-clang-13 create mode 100644 profiles/BSMPT/macos-release-armv8-clang-14 create mode 100644 profiles/BSMPT/macos-release-armv8-clang-15 create mode 100644 profiles/BSMPT/macos-release-x86_64-clang-13 create mode 100644 profiles/BSMPT/macos-release-x86_64-clang-14 create mode 100644 profiles/BSMPT/macos-release-x86_64-clang-15 diff --git a/Setup.py b/Setup.py index c6c3c8fc7..a9129e571 100644 --- a/Setup.py +++ b/Setup.py @@ -29,11 +29,15 @@ class BuildMode(ArgTypeEnum, Enum): def get_compiler(): compiler = "" - if sys.platform != "linux": + if sys.platform != "linux" and sys.platform != "darwin": return compiler - compiler += "-gcc-" - compiler += get_gcc_version() + if (sys.platform == "linux"): + compiler += "-gcc-" + + if (sys.platform == "darwin"): + compiler += "-clang-" + compiler += get_compiler_version() return compiler @@ -89,13 +93,20 @@ def check_profile(profile): check_profile(profile) -def get_gcc_version(): - version_response = subprocess.check_output( - "gcc --version".split(), encoding="UTF-8" - ).partition("\n")[0] - semver_string = version_response[version_response.rfind(" ") + 1 :] - major = semver_string.partition(".")[0] - return major +def get_compiler_version(): + if (sys.platform == "linux"): + version_response = subprocess.check_output( + "gcc --version".split(), encoding="UTF-8" + ).partition("\n")[0] + semver_string = version_response[version_response.rfind(" ") + 1 :] + return semver_string.partition(".")[0] + if (sys.platform == "darwin"): + version_response = subprocess.check_output( + "clang --version".split(), encoding="UTF-8" + ).partition("\n")[0] + semver_string = version_response[version_response.rfind("version") + 8 :] + return semver_string.partition(".")[0] + return "" def get_arch(): diff --git a/profiles/BSMPT/macos-debug-armv8-clang-13 b/profiles/BSMPT/macos-debug-armv8-clang-13 new file mode 100644 index 000000000..e4726bc74 --- /dev/null +++ b/profiles/BSMPT/macos-debug-armv8-clang-13 @@ -0,0 +1,8 @@ +[settings] +arch=armv8 +build_type=Debug +compiler=apple-clang +compiler.cppstd=gnu17 +compiler.libcxx=libc++ +compiler.version=13 +os=Macos \ No newline at end of file diff --git a/profiles/BSMPT/macos-debug-armv8-clang-14 b/profiles/BSMPT/macos-debug-armv8-clang-14 new file mode 100644 index 000000000..eb4b94512 --- /dev/null +++ b/profiles/BSMPT/macos-debug-armv8-clang-14 @@ -0,0 +1,8 @@ +[settings] +arch=armv8 +build_type=Debug +compiler=apple-clang +compiler.cppstd=gnu17 +compiler.libcxx=libc++ +compiler.version=14 +os=Macos \ No newline at end of file diff --git a/profiles/BSMPT/macos-debug-armv8-clang-15 b/profiles/BSMPT/macos-debug-armv8-clang-15 new file mode 100644 index 000000000..8fdb9a38c --- /dev/null +++ b/profiles/BSMPT/macos-debug-armv8-clang-15 @@ -0,0 +1,8 @@ +[settings] +arch=armv8 +build_type=Debug +compiler=apple-clang +compiler.cppstd=gnu17 +compiler.libcxx=libc++ +compiler.version=15 +os=Macos \ No newline at end of file diff --git a/profiles/BSMPT/macos-debug-x86_64-clang-13 b/profiles/BSMPT/macos-debug-x86_64-clang-13 new file mode 100644 index 000000000..ac0b66fdb --- /dev/null +++ b/profiles/BSMPT/macos-debug-x86_64-clang-13 @@ -0,0 +1,8 @@ +[settings] +arch=x86_64 +build_type=Debug +compiler=apple-clang +compiler.cppstd=gnu17 +compiler.libcxx=libc++ +compiler.version=13 +os=Macos \ No newline at end of file diff --git a/profiles/BSMPT/macos-debug-x86_64-clang-14 b/profiles/BSMPT/macos-debug-x86_64-clang-14 new file mode 100644 index 000000000..817affa59 --- /dev/null +++ b/profiles/BSMPT/macos-debug-x86_64-clang-14 @@ -0,0 +1,8 @@ +[settings] +arch=x86_64 +build_type=Debug +compiler=apple-clang +compiler.cppstd=gnu17 +compiler.libcxx=libc++ +compiler.version=14 +os=Macos \ No newline at end of file diff --git a/profiles/BSMPT/macos-debug-x86_64-clang-15 b/profiles/BSMPT/macos-debug-x86_64-clang-15 new file mode 100644 index 000000000..c00826963 --- /dev/null +++ b/profiles/BSMPT/macos-debug-x86_64-clang-15 @@ -0,0 +1,8 @@ +[settings] +arch=x86_64 +build_type=Debug +compiler=apple-clang +compiler.cppstd=gnu17 +compiler.libcxx=libc++ +compiler.version=15 +os=Macos \ No newline at end of file diff --git a/profiles/BSMPT/macos-release-armv8-clang-13 b/profiles/BSMPT/macos-release-armv8-clang-13 new file mode 100644 index 000000000..3735452a9 --- /dev/null +++ b/profiles/BSMPT/macos-release-armv8-clang-13 @@ -0,0 +1,8 @@ +[settings] +arch=armv8 +build_type=Release +compiler=apple-clang +compiler.cppstd=gnu17 +compiler.libcxx=libc++ +compiler.version=13 +os=Macos \ No newline at end of file diff --git a/profiles/BSMPT/macos-release-armv8-clang-14 b/profiles/BSMPT/macos-release-armv8-clang-14 new file mode 100644 index 000000000..2a2978b2d --- /dev/null +++ b/profiles/BSMPT/macos-release-armv8-clang-14 @@ -0,0 +1,8 @@ +[settings] +arch=armv8 +build_type=Release +compiler=apple-clang +compiler.cppstd=gnu17 +compiler.libcxx=libc++ +compiler.version=14 +os=Macos \ No newline at end of file diff --git a/profiles/BSMPT/macos-release-armv8-clang-15 b/profiles/BSMPT/macos-release-armv8-clang-15 new file mode 100644 index 000000000..fb43bb7e4 --- /dev/null +++ b/profiles/BSMPT/macos-release-armv8-clang-15 @@ -0,0 +1,8 @@ +[settings] +arch=armv8 +build_type=Release +compiler=apple-clang +compiler.cppstd=gnu17 +compiler.libcxx=libc++ +compiler.version=15 +os=Macos \ No newline at end of file diff --git a/profiles/BSMPT/macos-release-x86_64-clang-13 b/profiles/BSMPT/macos-release-x86_64-clang-13 new file mode 100644 index 000000000..f8741c347 --- /dev/null +++ b/profiles/BSMPT/macos-release-x86_64-clang-13 @@ -0,0 +1,8 @@ +[settings] +arch=x86_64 +build_type=Release +compiler=apple-clang +compiler.cppstd=gnu17 +compiler.libcxx=libc++ +compiler.version=13 +os=Macos \ No newline at end of file diff --git a/profiles/BSMPT/macos-release-x86_64-clang-14 b/profiles/BSMPT/macos-release-x86_64-clang-14 new file mode 100644 index 000000000..864a42b88 --- /dev/null +++ b/profiles/BSMPT/macos-release-x86_64-clang-14 @@ -0,0 +1,8 @@ +[settings] +arch=x86_64 +build_type=Release +compiler=apple-clang +compiler.cppstd=gnu17 +compiler.libcxx=libc++ +compiler.version=14 +os=Macos \ No newline at end of file diff --git a/profiles/BSMPT/macos-release-x86_64-clang-15 b/profiles/BSMPT/macos-release-x86_64-clang-15 new file mode 100644 index 000000000..a5118d292 --- /dev/null +++ b/profiles/BSMPT/macos-release-x86_64-clang-15 @@ -0,0 +1,8 @@ +[settings] +arch=x86_64 +build_type=Release +compiler=apple-clang +compiler.cppstd=gnu17 +compiler.libcxx=libc++ +compiler.version=15 +os=Macos \ No newline at end of file