[flang] Update CommandTest for AIX (NFC) (#118403)
[llvm-project.git] / clang / lib / Basic / CMakeLists.txt
blobe11e1ac4a6fa63270b64fccfea5d98bfbdd3e615
1 set(LLVM_LINK_COMPONENTS
2   Support
3   TargetParser
4   FrontendOpenMP
5   )
7 find_first_existing_vc_file("${LLVM_MAIN_SRC_DIR}" llvm_vc)
8 find_first_existing_vc_file("${CLANG_SOURCE_DIR}" clang_vc)
10 # The VC revision include that we want to generate.
11 set(version_inc "${CMAKE_CURRENT_BINARY_DIR}/VCSVersion.inc")
13 set(generate_vcs_version_script "${LLVM_CMAKE_DIR}/GenerateVersionFromVCS.cmake")
15 if(llvm_vc AND LLVM_APPEND_VC_REV)
16   set(llvm_source_dir ${LLVM_MAIN_SRC_DIR})
17 endif()
18 if (LLVM_VC_REPOSITORY AND LLVM_VC_REVISION)
19   set(llvm_source_dir ${LLVM_SOURCE_DIR})
20   set(llvm_vc_repository ${LLVM_VC_REPOSITORY})
21   set(llvm_vc_revision ${LLVM_VC_REVISION})
22 endif()
23 if(clang_vc AND LLVM_APPEND_VC_REV)
24   set(clang_source_dir ${CLANG_SOURCE_DIR})
25 endif()
26 if (CLANG_VC_REPOSITORY AND CLANG_VC_REVISION)
27   set(clang_source_dir ${CLANG_SOURCE_DIR})
28   set(clang_vc_repository ${CLANG_VC_REPOSITORY})
29   set(clang_vc_revision ${CLANG_VC_REVISION})
30 endif()
32 # Create custom target to generate the VC revision include.
33 add_custom_command(OUTPUT "${version_inc}"
34   DEPENDS "${llvm_vc}" "${clang_vc}" "${generate_vcs_version_script}"
35   COMMAND ${CMAKE_COMMAND} "-DNAMES=\"LLVM;CLANG\""
36                            "-DLLVM_SOURCE_DIR=${llvm_source_dir}"
37                            "-DCLANG_SOURCE_DIR=${clang_source_dir}"
38                            "-DCLANG_VC_REPOSITORY=${clang_vc_repository}"
39                            "-DCLANG_VC_REVISION=${clang_vc_revision}"
40                            "-DHEADER_FILE=${version_inc}"
41                            "-DLLVM_VC_REPOSITORY=${llvm_vc_repository}"
42                            "-DLLVM_VC_REVISION=${llvm_vc_revision}"
43                            "-DLLVM_FORCE_VC_REVISION=${LLVM_FORCE_VC_REVISION}"
44                            "-DLLVM_FORCE_VC_REPOSITORY=${LLVM_FORCE_VC_REPOSITORY}"
45                            -P "${generate_vcs_version_script}")
47 # Mark the generated header as being generated.
48 set_source_files_properties("${version_inc}"
49   PROPERTIES GENERATED TRUE
50              HEADER_FILE_ONLY TRUE)
52 if(CLANG_VENDOR)
53   set_source_files_properties(Version.cpp
54     PROPERTIES COMPILE_DEFINITIONS "CLANG_VENDOR=\"${CLANG_VENDOR} \"")
55 endif()
57 add_clang_library(clangBasic
58   ASTSourceDescriptor.cpp
59   Attributes.cpp
60   Builtins.cpp
61   CLWarnings.cpp
62   CharInfo.cpp
63   CodeGenOptions.cpp
64   Cuda.cpp
65   DarwinSDKInfo.cpp
66   Diagnostic.cpp
67   DiagnosticIDs.cpp
68   DiagnosticOptions.cpp
69   ExpressionTraits.cpp
70   FileEntry.cpp
71   FileManager.cpp
72   FileSystemStatCache.cpp
73   IdentifierTable.cpp
74   LangOptions.cpp
75   LangStandards.cpp
76   MakeSupport.cpp
77   Module.cpp
78   ObjCRuntime.cpp
79   OpenCLOptions.cpp
80   OpenMPKinds.cpp
81   OperatorPrecedence.cpp
82   ParsedAttrInfo.cpp
83   ProfileList.cpp
84   NoSanitizeList.cpp
85   SanitizerSpecialCaseList.cpp
86   Sanitizers.cpp
87   Sarif.cpp
88   SourceLocation.cpp
89   SourceManager.cpp
90   SourceMgrAdapter.cpp
91   Stack.cpp
92   StackExhaustionHandler.cpp
93   TargetID.cpp
94   TargetInfo.cpp
95   Targets.cpp
96   Targets/AArch64.cpp
97   Targets/AMDGPU.cpp
98   Targets/ARC.cpp
99   Targets/ARM.cpp
100   Targets/AVR.cpp
101   Targets/BPF.cpp
102   Targets/CSKY.cpp
103   Targets/DirectX.cpp
104   Targets/Hexagon.cpp
105   Targets/Lanai.cpp
106   Targets/LoongArch.cpp
107   Targets/M68k.cpp
108   Targets/MSP430.cpp
109   Targets/Mips.cpp
110   Targets/NVPTX.cpp
111   Targets/OSTargets.cpp
112   Targets/PNaCl.cpp
113   Targets/PPC.cpp
114   Targets/RISCV.cpp
115   Targets/SPIR.cpp
116   Targets/Sparc.cpp
117   Targets/SystemZ.cpp
118   Targets/TCE.cpp
119   Targets/VE.cpp
120   Targets/WebAssembly.cpp
121   Targets/X86.cpp
122   Targets/XCore.cpp
123   TokenKinds.cpp
124   TypeTraits.cpp
125   Version.cpp
126   Warnings.cpp
127   XRayInstr.cpp
128   XRayLists.cpp
129   ${version_inc}
131   DEPENDS
132   omp_gen
133   ClangDriverOptions
134   # These generated headers are included transitively.
135   ARMTargetParserTableGen
136   AArch64TargetParserTableGen
137   )
139 target_link_libraries(clangBasic
140   PRIVATE
141   ${LLVM_ATOMIC_LIB}