Skip to content

Commit

Permalink
Conan: Different profiles for different clang versions. (phbasler#145)
Browse files Browse the repository at this point in the history
* Conan: Different profiles for different clang versions.

* "get_gcc_version" -> "get_compiler_version"

---------

Co-authored-by: Philipp Basler <[email protected]>
  • Loading branch information
vollous and phbasler authored May 16, 2024
1 parent ad0e533 commit 2bd07b0
Show file tree
Hide file tree
Showing 13 changed files with 117 additions and 10 deletions.
31 changes: 21 additions & 10 deletions Setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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():
Expand Down
8 changes: 8 additions & 0 deletions profiles/BSMPT/macos-debug-armv8-clang-13
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[settings]
arch=armv8
build_type=Debug
compiler=apple-clang
compiler.cppstd=gnu17
compiler.libcxx=libc++
compiler.version=13
os=Macos
8 changes: 8 additions & 0 deletions profiles/BSMPT/macos-debug-armv8-clang-14
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[settings]
arch=armv8
build_type=Debug
compiler=apple-clang
compiler.cppstd=gnu17
compiler.libcxx=libc++
compiler.version=14
os=Macos
8 changes: 8 additions & 0 deletions profiles/BSMPT/macos-debug-armv8-clang-15
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[settings]
arch=armv8
build_type=Debug
compiler=apple-clang
compiler.cppstd=gnu17
compiler.libcxx=libc++
compiler.version=15
os=Macos
8 changes: 8 additions & 0 deletions profiles/BSMPT/macos-debug-x86_64-clang-13
Original file line number Diff line number Diff line change
@@ -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
8 changes: 8 additions & 0 deletions profiles/BSMPT/macos-debug-x86_64-clang-14
Original file line number Diff line number Diff line change
@@ -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
8 changes: 8 additions & 0 deletions profiles/BSMPT/macos-debug-x86_64-clang-15
Original file line number Diff line number Diff line change
@@ -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
8 changes: 8 additions & 0 deletions profiles/BSMPT/macos-release-armv8-clang-13
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[settings]
arch=armv8
build_type=Release
compiler=apple-clang
compiler.cppstd=gnu17
compiler.libcxx=libc++
compiler.version=13
os=Macos
8 changes: 8 additions & 0 deletions profiles/BSMPT/macos-release-armv8-clang-14
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[settings]
arch=armv8
build_type=Release
compiler=apple-clang
compiler.cppstd=gnu17
compiler.libcxx=libc++
compiler.version=14
os=Macos
8 changes: 8 additions & 0 deletions profiles/BSMPT/macos-release-armv8-clang-15
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[settings]
arch=armv8
build_type=Release
compiler=apple-clang
compiler.cppstd=gnu17
compiler.libcxx=libc++
compiler.version=15
os=Macos
8 changes: 8 additions & 0 deletions profiles/BSMPT/macos-release-x86_64-clang-13
Original file line number Diff line number Diff line change
@@ -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
8 changes: 8 additions & 0 deletions profiles/BSMPT/macos-release-x86_64-clang-14
Original file line number Diff line number Diff line change
@@ -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
8 changes: 8 additions & 0 deletions profiles/BSMPT/macos-release-x86_64-clang-15
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 2bd07b0

Please sign in to comment.