diff --git a/emper/Emper.hpp b/emper/Emper.hpp
index 985f190cdc372fcb9acf18522463738946dfacd5..64fda316acfb8fbca8a4b151392aa755d37175e3 100644
--- a/emper/Emper.hpp
+++ b/emper/Emper.hpp
@@ -264,7 +264,7 @@ static const enum ContinuationStealingMadviseStack CONTINUATION_STEALING_MADVISE
 		ContinuationStealingMadviseStack::EMPER_CONTINUATION_STEALING_MADVISE_STACK;
 
 static const bool BUILD_WITH_CLANG =
-#ifdef __clang__
+#ifdef EMPER_BUILD_WITH_CLANG
 		true
 #else
 		false
diff --git a/meson.build b/meson.build
index 5c74117e62568c72030687f23891af0d006197f3..a9a58266f815c19663684d4e487ccf3fc6795527 100644
--- a/meson.build
+++ b/meson.build
@@ -46,9 +46,11 @@ cpp_compiler = meson.get_compiler('cpp')
 if cpp_compiler.has_header('compare')
   conf_data.set('EMPER_HAS_COMPARE_H', true)
 endif
-if cpp_compiler.get_id() == 'clang'
+cpp_is_clang = cpp_compiler.get_id() == 'clang'
+if cpp_is_clang
   # Clang does not know "__attribute__((optimize(-no-omit-frame-pointer)))".
   add_project_arguments('-Wno-unknown-attributes', language: 'cpp')
+  conf_data.set('EMPER_BUILD_WITH_CLANG')
 endif
 
 continuation_stealing_mode = get_option('continuation_stealing_mode')