From db34f151779fbfc72a5c6d373b9b5b25da9085b7 Mon Sep 17 00:00:00 2001 From: Steven Le Rouzic Date: Sat, 17 Aug 2024 00:27:25 +0200 Subject: Enable compilation on ChromeOS --- .bazelrc | 6 +++++- BUILD.bazel | 1 - MODULE.bazel | 4 ++-- asl/meta.hpp | 6 +++--- asl/utility.hpp | 12 +++++++++++- todo.txt | 1 + 6 files changed, 22 insertions(+), 8 deletions(-) create mode 100644 todo.txt diff --git a/.bazelrc b/.bazelrc index 356c0c2..d90900f 100644 --- a/.bazelrc +++ b/.bazelrc @@ -1,4 +1,8 @@ -build --cxxopt=-Xclang=-std=c++20 +build:linux --repo_env=CC=clang + +build:windows --cxxopt=-Xclang=-std=c++20 +build:linux --cxxopt=-std=c++20 + build --cxxopt=-Wall build --cxxopt=-Wno-c++98-compat build --cxxopt=-Wno-c++98-compat-pedantic diff --git a/BUILD.bazel b/BUILD.bazel index b16b286..467c364 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -13,4 +13,3 @@ platform( "@bazel_tools//tools/cpp:clang-cl", ], ) - diff --git a/MODULE.bazel b/MODULE.bazel index 93439c6..169d023 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -8,10 +8,10 @@ git_override( ) register_execution_platforms( - "//:x64_windows-clang-cl" + # "//:x64_windows-clang-cl", ) register_toolchains( - "@@local_config_cc//:cc-toolchain-x64_windows-clang-cl", + # "@@local_config_cc//:cc-toolchain-x64_windows-clang-cl", ) diff --git a/asl/meta.hpp b/asl/meta.hpp index 614fa5d..4a5b448 100644 --- a/asl/meta.hpp +++ b/asl/meta.hpp @@ -85,9 +85,9 @@ template concept is_integral = __is_integral(T); template concept is_floating_point = __is_floating_point(T); template concept is_arithmetic = is_integral || is_floating_point; -template struct _is_array_helper : false_type {}; -template struct _is_array_helper : true_type {}; -template struct _is_array_helper : true_type {}; +template struct _is_array_helper : false_type {}; +template struct _is_array_helper : true_type {}; +template struct _is_array_helper : true_type {}; template concept is_array = _is_array_helper::value; diff --git a/asl/utility.hpp b/asl/utility.hpp index e8b9d86..33734a5 100644 --- a/asl/utility.hpp +++ b/asl/utility.hpp @@ -1,4 +1,14 @@ #pragma once -#define ASL_NO_UNIQUE_ADDRESS [[msvc::no_unique_address]] +#ifdef _MSVC_VER_ +#elif defined(__clang_version__) +#else + #error Not a valid environment +#endif + +#ifdef _MSVC_VER_ + #define ASL_NO_UNIQUE_ADDRESS [[msvc::no_unique_address]] +#else + #define ASL_NO_UNIQUE_ADDRESS [[no_unique_address]] +#endif diff --git a/todo.txt b/todo.txt new file mode 100644 index 0000000..27d7328 --- /dev/null +++ b/todo.txt @@ -0,0 +1 @@ +Platform config -- cgit