summaryrefslogtreecommitdiff
path: root/Lagom/CMakeLists.txt
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-07-26 11:02:47 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-07-26 11:03:19 +0200
commitbacbb52f2ea0d3e12f719ee7348af09e85432e95 (patch)
treec339e787e7ca2472c96b392f5898f325438fe276 /Lagom/CMakeLists.txt
parente423bb49014f8954c382fc19a8076b9142d3cba0 (diff)
downloadserenity-bacbb52f2ea0d3e12f719ee7348af09e85432e95.zip
Lagom: Let's not hard-code the compiler. Add compiler-relevant flags though.
I'm still getting the hang of this CMake thing.
Diffstat (limited to 'Lagom/CMakeLists.txt')
-rw-r--r--Lagom/CMakeLists.txt12
1 files changed, 8 insertions, 4 deletions
diff --git a/Lagom/CMakeLists.txt b/Lagom/CMakeLists.txt
index df5df86f22..e164c37c04 100644
--- a/Lagom/CMakeLists.txt
+++ b/Lagom/CMakeLists.txt
@@ -1,8 +1,12 @@
-cmake_minimum_required (VERSION 2.6)
+cmake_minimum_required (VERSION 3.0)
-set(CMAKE_C_COMPILER clang)
-set(CMAKE_CXX_COMPILER clang)
-set(CMAKE_CXX_FLAGS "-O2 -Wall -Wextra -Wconsumed -Werror -std=c++17 -fPIC")
+set(CMAKE_CXX_FLAGS "-O2 -Wall -Wextra -Werror -std=c++17 -fPIC")
+
+if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wconsumed")
+elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-expansion-to-defined")
+endif()
project (Lagom)