From 0019090172284d73500f8a12f3bcfc98b457a1cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E4=BA=8E=E6=96=8C?= <1931127624@qq.com> Date: Sun, 2 Aug 2020 14:02:44 +0800 Subject: [PATCH] [infra] Support GCC as compiler for Taichi developers (experimental) (#1598) * [infra] Support GCC as compiler for Taichi developers * revert --- cmake/TaichiCXXFlags.cmake | 4 ++++ taichi/util/action_recorder.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cmake/TaichiCXXFlags.cmake b/cmake/TaichiCXXFlags.cmake index 902261e3762ba..4313270baca19 100644 --- a/cmake/TaichiCXXFlags.cmake +++ b/cmake/TaichiCXXFlags.cmake @@ -25,7 +25,11 @@ else() if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") message("Clang compiler detected. Using std=c++17.") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -fsized-deallocation") + elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") + message("GNU compiler detected. Using std=c++17.") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -fsized-deallocation -Wno-class-memaccess -Wno-comment -Wno-sign-compare") else() + message("Invalid compiler ${CMAKE_CXX_COMPILER_ID} detected.") message(FATAL_ERROR "clang and MSVC are the only supported compilers for Taichi compiler development. Consider using 'cmake -DCMAKE_CXX_COMPILER=clang' if you are on Linux") endif() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall ") diff --git a/taichi/util/action_recorder.h b/taichi/util/action_recorder.h index f11d9522967d5..8de8f04ed7349 100644 --- a/taichi/util/action_recorder.h +++ b/taichi/util/action_recorder.h @@ -35,7 +35,7 @@ struct ActionArg { int64 val_int64; float64 val_float64; - enum argument_type { str, int64, float64 }; + enum class argument_type { str, int64, float64 }; argument_type type; };