Index: llvm/trunk/utils/gn/build/BUILD.gn =================================================================== --- llvm/trunk/utils/gn/build/BUILD.gn +++ llvm/trunk/utils/gn/build/BUILD.gn @@ -28,7 +28,6 @@ cflags_cc = [ "-std=c++11", "-fno-exceptions", - "-fno-rtti", "-fvisibility-inlines-hidden", ] } else { @@ -52,10 +51,7 @@ "_UNICODE", "UNICODE", ] - cflags += [ - "/EHs-c-", - "/GR-", - ] + cflags += [ "/EHs-c-" ] # The MSVC default value (1 MB) is not enough for parsing recursive C++ # templates in Clang. @@ -110,6 +106,14 @@ } } +config("no_rtti") { + if (current_os == "win") { + cflags_cc = [ "/GR-" ] + } else { + cflags_cc = [ "-fno-rtti" ] + } +} + config("llvm_code") { include_dirs = [ "//llvm/include", Index: llvm/trunk/utils/gn/build/BUILDCONFIG.gn =================================================================== --- llvm/trunk/utils/gn/build/BUILDCONFIG.gn +++ llvm/trunk/utils/gn/build/BUILDCONFIG.gn @@ -5,6 +5,7 @@ shared_binary_target_configs = [ "//llvm/utils/gn/build:compiler_defaults", "//llvm/utils/gn/build:llvm_code", + "//llvm/utils/gn/build:no_rtti", "//llvm/utils/gn/build:warn_covered_switch_default", ]