1 set(LLVM_LINK_COMPONENTS mc) 2 3 add_clang_library(clangBasic 4 Builtins.cpp 5 CharInfo.cpp 6 Diagnostic.cpp 7 DiagnosticIDs.cpp 8 FileManager.cpp 9 FileSystemStatCache.cpp 10 IdentifierTable.cpp 11 LangOptions.cpp 12 Module.cpp 13 ObjCRuntime.cpp 14 OpenMPKinds.cpp 15 OperatorPrecedence.cpp 16 SourceLocation.cpp 17 SourceManager.cpp 18 TargetInfo.cpp 19 Targets.cpp 20 TokenKinds.cpp 21 Version.cpp 22 VersionTuple.cpp 23 ) 24 25 # Determine Subversion revision. 26 # FIXME: This only gets updated when CMake is run, so this revision number 27 # may be out-of-date! 28 if( NOT IS_SYMLINK "${CLANG_SOURCE_DIR}" ) # See PR 8437 29 find_package(Subversion) 30 endif() 31 if (Subversion_FOUND AND EXISTS "${CLANG_SOURCE_DIR}/.svn") 32 # Create custom target to generate the Subversion version include. 33 add_custom_target(clang_revision_tag ALL 34 COMMAND ${CMAKE_COMMAND} -DFIRST_SOURCE_DIR=${LLVM_MAIN_SRC_DIR} 35 -DFIRST_REPOSITORY=LLVM_REPOSITORY 36 -DSECOND_SOURCE_DIR=${CLANG_SOURCE_DIR} 37 -DSECOND_REPOSITORY=SVN_REPOSITORY 38 -DHEADER_FILE=${CMAKE_CURRENT_BINARY_DIR}/SVNVersion.inc 39 -P ${LLVM_MAIN_SRC_DIR}/cmake/modules/GetSVN.cmake) 40 41 # Mark the generated header as being generated. 42 message(STATUS "Expecting header to go in ${CMAKE_CURRENT_BINARY_DIR}/SVNVersion.inc") 43 set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/SVNVersion.inc 44 PROPERTIES GENERATED TRUE 45 HEADER_FILE_ONLY TRUE) 46 47 # Tell Version.cpp that it needs to build with -DHAVE_SVN_VERSION_INC. 48 set_source_files_properties(Version.cpp 49 PROPERTIES COMPILE_DEFINITIONS "HAVE_SVN_VERSION_INC") 50 51 endif() 52 53 add_dependencies(clangBasic 54 ClangARMNeon 55 ClangAttrList 56 ClangDiagnosticAnalysis 57 ClangDiagnosticAST 58 ClangDiagnosticComment 59 ClangDiagnosticCommon 60 ClangDiagnosticDriver 61 ClangDiagnosticFrontend 62 ClangDiagnosticGroups 63 ClangDiagnosticIndexName 64 ClangDiagnosticLex 65 ClangDiagnosticParse 66 ClangDiagnosticSema 67 ClangDiagnosticSerialization 68 ) 69 70 # clangBasic depends on the version. 71 if (Subversion_FOUND AND EXISTS "${CLANG_SOURCE_DIR}/.svn") 72 add_dependencies(clangBasic clang_revision_tag) 73 endif()