Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conan: Different profiles for different clang versions. #145

Merged
merged 3 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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