From d3aa6c5272794339d0fdeacc553cbfad97ba67e5 Mon Sep 17 00:00:00 2001 From: Dmitri Gribenko Date: Wed, 7 Nov 2012 23:52:25 +0000 Subject: [PATCH] Force C89 for c-index-test.c MSVC supports only C89, so it is important to keep c-index-test.c buildable with C89. However, Clang defaults to C99, so while building Clang with Clang one can introduce C99 constructs into c-index-test.c without noticing. Thanks to Nakamura Takumi for helping with MSVC bits. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167561 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/c-index-test/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/c-index-test/CMakeLists.txt b/tools/c-index-test/CMakeLists.txt index 6379194c55..6f28c546cf 100644 --- a/tools/c-index-test/CMakeLists.txt +++ b/tools/c-index-test/CMakeLists.txt @@ -7,6 +7,13 @@ add_clang_executable(c-index-test c-index-test.c ) +if(NOT MSVC) + set_property( + SOURCE c-index-test.c + PROPERTY COMPILE_FLAGS "-std=c89" + ) +endif() + target_link_libraries(c-index-test libclang ) -- 2.40.0