summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Le Rouzic <steven.lerouzic@gmail.com>2024-08-17 00:27:25 +0200
committerSteven Le Rouzic <steven.lerouzic@gmail.com>2024-08-17 00:28:03 +0200
commitdb34f151779fbfc72a5c6d373b9b5b25da9085b7 (patch)
tree1c0b6c91d6b04e0f812b41c99199e52698bc53f3
parent4ad4091b38faa39ddd2deae7455bd3a26531994f (diff)
Enable compilation on ChromeOS
-rw-r--r--.bazelrc6
-rw-r--r--BUILD.bazel1
-rw-r--r--MODULE.bazel4
-rw-r--r--asl/meta.hpp6
-rw-r--r--asl/utility.hpp12
-rw-r--r--todo.txt1
6 files changed, 22 insertions, 8 deletions
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<typename T> concept is_integral = __is_integral(T);
template<typename T> concept is_floating_point = __is_floating_point(T);
template<typename T> concept is_arithmetic = is_integral<T> || is_floating_point<T>;
-template<typename T> struct _is_array_helper : false_type {};
-template<typename T> struct _is_array_helper<T[]> : true_type {};
-template<typename T, size_t N> struct _is_array_helper<T[N]> : true_type {};
+template<typename T> struct _is_array_helper : false_type {};
+template<typename T> struct _is_array_helper<T[]> : true_type {};
+template<typename T, int N> struct _is_array_helper<T[N]> : true_type {};
template<typename T> concept is_array = _is_array_helper<T>::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