diff options
author | John Thompson <John.Thompson.JTSoftware@gmail.com> | 2009-10-27 13:42:56 +0000 |
---|---|---|
committer | John Thompson <John.Thompson.JTSoftware@gmail.com> | 2009-10-27 13:42:56 +0000 |
commit | 2e06fc877a633abea3b40a64950c7316dac29ca8 (patch) | |
tree | 04a9b4fba11ef15df4625e6c50d21234e41c7372 /tools | |
parent | cc179cb24ffc6686c788c6849e59fc1b04ecf03e (diff) |
Changes for building as a Windows DLL
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85234 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r-- | tools/CIndex/CMakeLists.txt | 1 | ||||
-rw-r--r-- | tools/CMakeLists.txt | 5 | ||||
-rw-r--r-- | tools/c-index-test/c-index-test.c | 16 |
3 files changed, 18 insertions, 4 deletions
diff --git a/tools/CIndex/CMakeLists.txt b/tools/CIndex/CMakeLists.txt index ee77c0398f..dd0eeea944 100644 --- a/tools/CIndex/CMakeLists.txt +++ b/tools/CIndex/CMakeLists.txt @@ -26,6 +26,7 @@ if(MSVC) # windows.h doesn't compile with /Za get_target_property(NON_ANSI_COMPILE_FLAGS CIndex COMPILE_FLAGS) string(REPLACE /Za "" NON_ANSI_COMPILE_FLAGS ${NON_ANSI_COMPILE_FLAGS}) + set(NON_ANSI_COMPILE_FLAGS "${NON_ANSI_COMPILE_FLAGS} /D_CINDEX_LIB_") set_target_properties(CIndex PROPERTIES COMPILE_FLAGS ${NON_ANSI_COMPILE_FLAGS}) endif(MSVC) diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index cb2aa2004c..222512af15 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -6,7 +6,4 @@ if (CLANG_BUILD_EXPERIMENTAL) add_subdirectory(wpa) endif () add_subdirectory(CIndex) -if (MSVC) -else () - add_subdirectory(c-index-test) -endif () +add_subdirectory(c-index-test) diff --git a/tools/c-index-test/c-index-test.c b/tools/c-index-test/c-index-test.c index cf2a706891..56b29ac136 100644 --- a/tools/c-index-test/c-index-test.c +++ b/tools/c-index-test/c-index-test.c @@ -4,7 +4,23 @@ #include <stdio.h> #include <string.h> +#ifdef _MSC_VER +char *basename(const char* path) +{ + char* base1 = (char*)strrchr(path, '/'); + char* base2 = (char*)strrchr(path, '\\'); + if (base1 && base2) + return((base1 > base2) ? base1 + 1 : base2 + 1); + else if (base1) + return(base1 + 1); + else if (base2) + return(base2 + 1); + + return((char*)path); +} +#else extern char *basename(const char *); +#endif static void PrintCursor(CXCursor Cursor) { if (clang_isInvalid(Cursor.kind)) |