Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 420 lines (351 sloc) 13.796 kB
34fc517 CMake: Added notes pointing to the LLVM CMake documentation.
Oscar Fuentes authored
1 # See docs/CMake.html for instructions about how to build LLVM with CMake.
2
1d083f4 @Stilgar84 Change the name of the generated solution file for a CMake build. (fr…
Stilgar84 authored
3 project(LLVM)
c677c5d Bump cmake_minimum_required to version 2.8
Oscar Fuentes authored
4 cmake_minimum_required(VERSION 2.8)
3d01fc7 Initial support for the CMake build system.
Oscar Fuentes authored
5
ee99317 CMake: add version control info to PACKAGE_VERSION, if available.
Oscar Fuentes authored
6 # Add path for custom modules
7 set(CMAKE_MODULE_PATH
8 ${CMAKE_MODULE_PATH}
9 "${CMAKE_CURRENT_SOURCE_DIR}/cmake"
10 "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules"
11 )
12
ebc2fc1 @isanbard Change the next release number to 3.0svn.
isanbard authored
13 set(PACKAGE_VERSION "3.0")
784a176 New cmake option LLVM_APPEND_VC_REV for controlling when the VC
Oscar Fuentes authored
14
0b85d07 Put targets on folders, if the IDE supports the feature.
Oscar Fuentes authored
15 set_property(GLOBAL PROPERTY USE_FOLDERS ON)
16
ee99317 CMake: add version control info to PACKAGE_VERSION, if available.
Oscar Fuentes authored
17 include(VersionFromVCS)
784a176 New cmake option LLVM_APPEND_VC_REV for controlling when the VC
Oscar Fuentes authored
18
19 option(LLVM_APPEND_VC_REV
20 "Append the version control system revision id to LLVM version" OFF)
21
22 if( LLVM_APPEND_VC_REV )
23 add_version_info_from_vcs(PACKAGE_VERSION)
24 endif()
ee99317 CMake: add version control info to PACKAGE_VERSION, if available.
Oscar Fuentes authored
25
3d01fc7 Initial support for the CMake build system.
Oscar Fuentes authored
26 set(PACKAGE_NAME llvm)
8c46e85 Enable PACKAGE_VERSION in cmake builds, this unbreaks the clang build…
Chris Lattner authored
27 set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
f7e73b9 CMake: Directed bug reports to llvmbugs.
Oscar Fuentes authored
28 set(PACKAGE_BUGREPORT "llvmbugs@cs.uiuc.edu")
3d01fc7 Initial support for the CMake build system.
Oscar Fuentes authored
29
a0c8d2d @ddunbar build/cmake: Coalesce in-tree sanity checks.
ddunbar authored
30 # Sanity check our source directory to make sure that we are not trying to
31 # generate an in-tree build (unless on MSVC_IDE, where it is ok), and to make
32 # sure that we don't have any stray generated files lying around in the tree
33 # (which would end up getting picked up by header search, instead of the correct
34 # versions).
6326a0d CMake: Disallow in-source builds except when building with the Visual
Oscar Fuentes authored
35 if( CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR AND NOT MSVC_IDE )
36 message(FATAL_ERROR "In-source builds are not allowed.
37 CMake would overwrite the makefiles distributed with LLVM.
38 Please create a directory and run cmake from there, passing the path
39 to this source directory as the last argument.
40 This process created the file `CMakeCache.txt' and the directory `CMakeFiles'.
41 Please delete them.")
42 endif()
6761c5d CMake: Refuses to work for out-of-source builds when tablegenned files
Oscar Fuentes authored
43 if( NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR )
44 file(GLOB_RECURSE
45 tablegenned_files_on_include_dir
a0c8d2d @ddunbar build/cmake: Coalesce in-tree sanity checks.
ddunbar authored
46 "${CMAKE_CURRENT_SOURCE_DIR}/include/llvm/*.gen")
6761c5d CMake: Refuses to work for out-of-source builds when tablegenned files
Oscar Fuentes authored
47 file(GLOB_RECURSE
48 tablegenned_files_on_lib_dir
a0c8d2d @ddunbar build/cmake: Coalesce in-tree sanity checks.
ddunbar authored
49 "${CMAKE_CURRENT_SOURCE_DIR}/lib/Target/*.inc")
6761c5d CMake: Refuses to work for out-of-source builds when tablegenned files
Oscar Fuentes authored
50 if( tablegenned_files_on_include_dir OR tablegenned_files_on_lib_dir)
51 message(FATAL_ERROR "Apparently there is a previous in-source build,
52 probably as the result of running `configure' and `make' on
a0c8d2d @ddunbar build/cmake: Coalesce in-tree sanity checks.
ddunbar authored
53 ${CMAKE_CURRENT_SOURCE_DIR}.
6761c5d CMake: Refuses to work for out-of-source builds when tablegenned files
Oscar Fuentes authored
54 This may cause problems. The suspicious files are:
55 ${tablegenned_files_on_lib_dir}
56 ${tablegenned_files_on_include_dir}
57 Please clean the source directory.")
58 endif()
59 endif()
60
a0c8d2d @ddunbar build/cmake: Coalesce in-tree sanity checks.
ddunbar authored
61 string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
62
63 set(LLVM_MAIN_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR})
64 set(LLVM_MAIN_INCLUDE_DIR ${LLVM_MAIN_SRC_DIR}/include)
65 set(LLVM_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
66 set(LLVM_TOOLS_BINARY_DIR ${LLVM_BINARY_DIR}/bin)
67 set(LLVM_EXAMPLES_BINARY_DIR ${LLVM_BINARY_DIR}/examples)
68 set(LLVM_LIBDIR_SUFFIX "" CACHE STRING "Define suffix of library directory name (32/64)" )
69
4f21c13 CMake: Implement magic word `all' for selecting all targets. Check
Oscar Fuentes authored
70 set(LLVM_ALL_TARGETS
71 ARM
72 CBackend
73 CellSPU
74 CppBackend
75 Mips
c84a956 Adding MBlaze to cmake target list.
Wesley Peck authored
76 MBlaze
a51984b bug 4524: Add MSP430 to the cmake build.
Richard Pennington authored
77 MSP430
4f21c13 CMake: Implement magic word `all' for selecting all targets. Check
Oscar Fuentes authored
78 PowerPC
b2c70cf Added PTX target to the CMake build.
Oscar Fuentes authored
79 PTX
4f21c13 CMake: Implement magic word `all' for selecting all targets. Check
Oscar Fuentes authored
80 Sparc
81 X86
82 XCore
83 )
84
db3480c Supports building with a list of targets that does not contain
Oscar Fuentes authored
85 # List of targets with JIT support:
dca6cdd @bcardosolopes Added the infrastructute necessary for MIPS JIT support. Patch by Vla…
bcardosolopes authored
86 set(LLVM_TARGETS_WITH_JIT X86 PowerPC ARM Mips)
db3480c Supports building with a list of targets that does not contain
Oscar Fuentes authored
87
e1ad087 CMake: Builds all targets.
Oscar Fuentes authored
88 if( MSVC )
89 set(LLVM_TARGETS_TO_BUILD X86
4f21c13 CMake: Implement magic word `all' for selecting all targets. Check
Oscar Fuentes authored
90 CACHE STRING "Semicolon-separated list of targets to build, or \"all\".")
e1ad087 CMake: Builds all targets.
Oscar Fuentes authored
91 else( MSVC )
4f21c13 CMake: Implement magic word `all' for selecting all targets. Check
Oscar Fuentes authored
92 set(LLVM_TARGETS_TO_BUILD ${LLVM_ALL_TARGETS}
93 CACHE STRING "Semicolon-separated list of targets to build, or \"all\".")
e1ad087 CMake: Builds all targets.
Oscar Fuentes authored
94 endif( MSVC )
3d01fc7 Initial support for the CMake build system.
Oscar Fuentes authored
95
19823b1 Add to the CMake build some options and platform tests supported by
Oscar Fuentes authored
96 option(LLVM_ENABLE_CBE_PRINTF_A "Set to ON if CBE is enabled for printf %a output" ON)
97 if(LLVM_ENABLE_CBE_PRINTF_A)
98 set(ENABLE_CBE_PRINTF_A 1)
99 endif()
100
101 option(LLVM_ENABLE_TIMESTAMPS "Enable embedding timestamp information in build" ON)
102 if(LLVM_ENABLE_TIMESTAMPS)
103 set(ENABLE_TIMESTAMPS 1)
104 endif()
105
5969379 Handles libffi on the CMake build.
Oscar Fuentes authored
106 option(LLVM_ENABLE_FFI "Use libffi to call external functions from the interpreter" OFF)
107 set(FFI_LIBRARY_DIR "" CACHE PATH "Additional directory, where CMake should search for libffi.so")
108 set(FFI_INCLUDE_DIR "" CACHE PATH "Additional directory, where CMake should search for ffi.h or ffi/ffi.h")
109
a9ff139 CMake: New user-settable variable LLVM_TARGET_ARCH useful when
Oscar Fuentes authored
110 set(LLVM_TARGET_ARCH "host"
111 CACHE STRING "Set target to use for LLVM JIT or use \"host\" for automatic detection.")
112
4b44283 CMake: Option for enabling/disabling threads.
Oscar Fuentes authored
113 option(LLVM_ENABLE_THREADS "Use threads if available." ON)
114
4f21c13 CMake: Implement magic word `all' for selecting all targets. Check
Oscar Fuentes authored
115 if( LLVM_TARGETS_TO_BUILD STREQUAL "all" )
116 set( LLVM_TARGETS_TO_BUILD ${LLVM_ALL_TARGETS} )
117 endif()
118
1555a23 Introduce new headers whose inclusion forces linking and
Douglas Gregor authored
119 set(LLVM_ENUM_TARGETS "")
4f21c13 CMake: Implement magic word `all' for selecting all targets. Check
Oscar Fuentes authored
120 foreach(c ${LLVM_TARGETS_TO_BUILD})
121 list(FIND LLVM_ALL_TARGETS ${c} idx)
122 if( idx LESS 0 )
9befba8 @ggreif here comes the CMAKE part on LLVM_COMPACT_SENTINELS; see also r78628 …
ggreif authored
123 message(FATAL_ERROR "The target `${c}' does not exist.
4f21c13 CMake: Implement magic word `all' for selecting all targets. Check
Oscar Fuentes authored
124 It should be one of\n${LLVM_ALL_TARGETS}")
1555a23 Introduce new headers whose inclusion forces linking and
Douglas Gregor authored
125 else()
126 set(LLVM_ENUM_TARGETS "${LLVM_ENUM_TARGETS}LLVM_TARGET(${c})\n")
4f21c13 CMake: Implement magic word `all' for selecting all targets. Check
Oscar Fuentes authored
127 endif()
128 endforeach(c)
129
3d01fc7 Initial support for the CMake build system.
Oscar Fuentes authored
130 set(llvm_builded_incs_dir ${LLVM_BINARY_DIR}/include/llvm)
131
9a0107d CMake: defines and uses macro add_llvm_definitions for keeping track
Oscar Fuentes authored
132 include(AddLLVMDefinitions)
133
1e02bf0 CMake: LLVM_ENABLE_PIC now defaults to ON, as in `configure'. This is
Oscar Fuentes authored
134 option(LLVM_ENABLE_PIC "Build Position-Independent Code" ON)
64fb4c8 CMake: Option for building with -fPIC.
Oscar Fuentes authored
135
d9f574b Cmake fix for option defaults not being set correctly on first run
Oscar Fuentes authored
136 # MSVC has a gazillion warnings with this.
137 if( MSVC )
138 option(LLVM_ENABLE_WARNINGS "Enable compiler warnings." OFF)
139 else( MSVC )
140 option(LLVM_ENABLE_WARNINGS "Enable compiler warnings." ON)
141 endif()
d538e24 Changes for building Clang and others using LLVM as an external
Oscar Fuentes authored
142
d9f574b Cmake fix for option defaults not being set correctly on first run
Oscar Fuentes authored
143 option(LLVM_ENABLE_PEDANTIC "Compile with pedantic enabled." ON)
144 option(LLVM_ENABLE_WERROR "Fail and stop if a warning is triggered." OFF)
d538e24 Changes for building Clang and others using LLVM as an external
Oscar Fuentes authored
145
146 if( uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE" )
147 option(LLVM_ENABLE_ASSERTIONS "Enable assertions" OFF)
148 else()
149 option(LLVM_ENABLE_ASSERTIONS "Enable assertions" ON)
64fb4c8 CMake: Option for building with -fPIC.
Oscar Fuentes authored
150 endif()
151
c8f399d @ddunbar build/cmake: Move all the user controllable options into top-level CM…
ddunbar authored
152 # Define an option controlling whether we should build for 32-bit on 64-bit
153 # platforms, where supported.
154 if( CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT WIN32 )
155 # TODO: support other platforms and toolchains.
156 option(LLVM_BUILD_32_BITS "Build 32 bits executables and libraries." OFF)
157 endif()
158
159 # Define the default arguments to use with 'lit', and an option for the user to
160 # override.
161 set(LIT_ARGS_DEFAULT "-sv")
162 if (MSVC OR XCODE)
163 set(LIT_ARGS_DEFAULT "${LIT_ARGS_DEFAULT} --no-progress-bar")
164 endif()
165 set(LLVM_LIT_ARGS "${LIT_ARGS_DEFAULT}" CACHE STRING "Default options for lit")
166
167 # On Win32/Cygwin, provide an option to specify the path to the GnuWin32 tools.
168 if( WIN32 AND CYGWIN )
169 set(LLVM_LIT_TOOLS_DIR "" CACHE PATH "Path to GnuWin32 tools")
170 endif()
171
172 # On Win32 using MS tools, provide an option to set the number of parallel jobs
173 # to use.
174 if( MSVC_IDE AND ( MSVC90 OR MSVC10 ) )
175 # Only Visual Studio 2008 and 2010 officially supports /MP. Visual Studio
176 # 2005 supports it but it is experimental.
177 set(LLVM_COMPILER_JOBS "0" CACHE STRING
178 "Number of parallel compiler jobs. 0 means use all processors. Default is 0.")
179 endif()
180
275f686 @ddunbar build/cmake: Tidy up specification of build/include options for (tool…
ddunbar authored
181 # Define options to control the inclusion and default build behavior for
182 # components which may not strictly be necessary (tools, runtime, examples, and
183 # tests).
184 #
185 # This is primarily to support building smaller or faster project files.
186 option(LLVM_INCLUDE_TOOLS "Generate build targets for the LLVM tools." ON)
187 option(LLVM_BUILD_TOOLS
188 "Build the LLVM tools. If OFF, just generate build targets." ON)
189
190 option(LLVM_INCLUDE_RUNTIME "Generate build targets for the LLVM runtimes" ON)
191 option(LLVM_BUILD_RUNTIME
192 "Build the LLVM runtime libraries. If OFF, just generate build targets." ON)
193
194 option(LLVM_BUILD_EXAMPLES
195 "Build the LLVM example programs. If OFF, just generate build targets." OFF)
196 option(LLVM_INCLUDE_EXAMPLES "Generate build targets for the LLVM examples" ON)
197
198 option(LLVM_BUILD_TESTS
199 "Build LLVM unit tests. If OFF, just generate build targets." OFF)
200 option(LLVM_INCLUDE_TESTS "Generate build targets for the LLVM unit tests." ON)
201
7a2bdde Fix a ton of comment typos found by codespell. Patch by
Chris Lattner authored
202 # All options referred to from HandleLLVMOptions have to be specified
d9f574b Cmake fix for option defaults not being set correctly on first run
Oscar Fuentes authored
203 # BEFORE this include, otherwise options will not be correctly set on
204 # first cmake run
205 include(config-ix)
206 include(HandleLLVMOptions)
207
a54c8ea @ddunbar build/cmake: Change to require Python be available.
ddunbar authored
208 # Verify that we can find a Python interpreter,
209 include(FindPythonInterp)
210 if( NOT PYTHONINTERP_FOUND )
211 message(FATAL_ERROR
212 "Unable to find Python interpreter, required for builds and testing.
213
214 Please install Python or specify the PYTHON_EXECUTABLE CMake variable.")
215 endif()
216
965d2fe @ddunbar build/cmake: Enable initial llvm-build integration.
ddunbar authored
217 ######
218 # LLVMBuild Integration
219 #
220 # We use llvm-build to generate all the data required by the CMake based
221 # build system in one swoop:
222 #
223 # - We generate a file (a CMake fragment) in the object root which contains
224 # all the definitions that are required by CMake.
225 #
226 # - We generate the library table used by llvm-config.
227 #
228 # - We generate the dependencies for the CMake fragment, so that we will
229 # automatically reconfigure outselves.
230
231 set(LLVMBUILDTOOL "${LLVM_MAIN_SRC_DIR}/utils/llvm-build/llvm-build")
232 set(LLVMCONFIGLIBRARYDEPENDENCIESINC
233 "${LLVM_BINARY_DIR}/tools/llvm-config-2/LibraryDependencies.inc")
234 set(LLVMBUILDCMAKEFRAG
235 "${LLVM_BINARY_DIR}/LLVMBuild.cmake")
236 message(STATUS "Constructing LLVMBuild project information")
237 execute_process(
238 COMMAND ${PYTHON_EXECUTABLE} ${LLVMBUILDTOOL}
239 --write-library-table ${LLVMCONFIGLIBRARYDEPENDENCIESINC}
240 --write-cmake-fragment ${LLVMBUILDCMAKEFRAG}
241 ERROR_VARIABLE LLVMBUILDOUTPUT
242 ERROR_VARIABLE LLVMBUILDERRORS
243 OUTPUT_STRIP_TRAILING_WHITESPACE
244 ERROR_STRIP_TRAILING_WHITESPACE
245 RESULT_VARIABLE LLVMBUILDRESULT)
246
247 # On Win32, CMake doesn't properly handle piping the default output/error
248 # streams into the GUI console. So, we explicitly catch and report them.
249 if( NOT "${LLVMBUILDOUTPUT}" STREQUAL "")
250 message(STATUS "llvm-build output: ${LLVMBUILDOUTPUT}")
251 endif()
252 if( NOT "${LLVMBUILDRESULT}" STREQUAL "0" )
253 message(FATAL_ERROR
254 "Unexpected failure executing llvm-build: ${LLVMBUILDERRORS}")
255 endif()
256
257 # Include the generated CMake fragment. This will define properties from the
258 # LLVMBuild files in a format which is easy to consume from CMake, and will add
259 # the dependencies so that CMake will reconfigure properly when the LLVMBuild
260 # files change.
261 include(${LLVMBUILDCMAKEFRAG})
262
263 ######
264
7b1dd9a @ddunbar build/cmake: Coalesce the configuration time header include fragment …
ddunbar authored
265 # Configure all of the various header file fragments LLVM uses which depend on
266 # configuration variables.
267 set(LLVM_ENUM_ASM_PRINTERS "")
268 set(LLVM_ENUM_ASM_PARSERS "")
269 set(LLVM_ENUM_DISASSEMBLERS "")
270 foreach(t ${LLVM_TARGETS_TO_BUILD})
271 set( td ${LLVM_MAIN_SRC_DIR}/lib/Target/${t} )
272 file(GLOB asmp_file "${td}/*AsmPrinter.cpp")
273 if( asmp_file )
274 set(LLVM_ENUM_ASM_PRINTERS
275 "${LLVM_ENUM_ASM_PRINTERS}LLVM_ASM_PRINTER(${t})\n")
276 endif()
277 if( EXISTS ${td}/AsmParser/CMakeLists.txt )
278 set(LLVM_ENUM_ASM_PARSERS
279 "${LLVM_ENUM_ASM_PARSERS}LLVM_ASM_PARSER(${t})\n")
280 endif()
281 if( EXISTS ${td}/Disassembler/CMakeLists.txt )
282 set(LLVM_ENUM_DISASSEMBLERS
283 "${LLVM_ENUM_DISASSEMBLERS}LLVM_DISASSEMBLER(${t})\n")
284 endif()
285 endforeach(t)
286
287 # Produce the target definition files, which provide a way for clients to easily
288 # include various classes of targets.
289 configure_file(
290 ${LLVM_MAIN_INCLUDE_DIR}/llvm/Config/AsmPrinters.def.in
291 ${LLVM_BINARY_DIR}/include/llvm/Config/AsmPrinters.def
292 )
293 configure_file(
294 ${LLVM_MAIN_INCLUDE_DIR}/llvm/Config/AsmParsers.def.in
295 ${LLVM_BINARY_DIR}/include/llvm/Config/AsmParsers.def
296 )
297 configure_file(
298 ${LLVM_MAIN_INCLUDE_DIR}/llvm/Config/Disassemblers.def.in
299 ${LLVM_BINARY_DIR}/include/llvm/Config/Disassemblers.def
300 )
301 configure_file(
302 ${LLVM_MAIN_INCLUDE_DIR}/llvm/Config/Targets.def.in
303 ${LLVM_BINARY_DIR}/include/llvm/Config/Targets.def
304 )
305
306 # Configure the three LLVM configuration header files.
d538e24 Changes for building Clang and others using LLVM as an external
Oscar Fuentes authored
307 configure_file(
308 ${LLVM_MAIN_INCLUDE_DIR}/llvm/Config/config.h.cmake
309 ${LLVM_BINARY_DIR}/include/llvm/Config/config.h)
310 configure_file(
311 ${LLVM_MAIN_INCLUDE_DIR}/llvm/Config/llvm-config.h.cmake
312 ${LLVM_BINARY_DIR}/include/llvm/Config/llvm-config.h)
313 configure_file(
314 ${LLVM_MAIN_INCLUDE_DIR}/llvm/Support/DataTypes.h.cmake
315 ${LLVM_BINARY_DIR}/include/llvm/Support/DataTypes.h)
2c5e0b8 Rewrite handling of LLVM_ENABLE_PIC. It was being processed after
Oscar Fuentes authored
316
3d01fc7 Initial support for the CMake build system.
Oscar Fuentes authored
317 set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LLVM_TOOLS_BINARY_DIR} )
318 set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/lib )
319 set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/lib )
320
c08830d Add current binary and source directories to the header search list
Oscar Fuentes authored
321 set(CMAKE_INCLUDE_CURRENT_DIR ON)
322
980e842 CMake: Removed some cruft.
Oscar Fuentes authored
323 include_directories( ${LLVM_BINARY_DIR}/include ${LLVM_MAIN_INCLUDE_DIR})
3d01fc7 Initial support for the CMake build system.
Oscar Fuentes authored
324
c6cf5fe @eocallaghan Fix LLVM CMake build system so that it may now work on Solaris and Au…
eocallaghan authored
325 if( ${CMAKE_SYSTEM_NAME} MATCHES SunOS )
2341a3c Fix CMake build on Solaris
Oscar Fuentes authored
326 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -include llvm/Support/Solaris.h")
c6cf5fe @eocallaghan Fix LLVM CMake build system so that it may now work on Solaris and Au…
eocallaghan authored
327 endif( ${CMAKE_SYSTEM_NAME} MATCHES SunOS )
328
3d01fc7 Initial support for the CMake build system.
Oscar Fuentes authored
329 include(AddLLVM)
e1ad087 CMake: Builds all targets.
Oscar Fuentes authored
330 include(TableGen)
3d01fc7 Initial support for the CMake build system.
Oscar Fuentes authored
331
1c4e934 @Bigcheese CMake: Fix mingw32 build.
Bigcheese authored
332 if( MINGW )
53bf3ee Don't use -O3 on Mingw, as people report it as unreliable. Use -O2
Oscar Fuentes authored
333 # People report that -O3 is unreliable on MinGW. The traditional
334 # build also uses -O2 for that reason:
335 llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O2")
336 endif()
337
6d857ca Move library stuff out of the toplevel CMakeLists.txt file.
Oscar Fuentes authored
338 # Put this before tblgen. Else we have a circular dependence.
3d01fc7 Initial support for the CMake build system.
Oscar Fuentes authored
339 add_subdirectory(lib/Support)
7c78888 @pcc Move TableGen's parser and entry point into a library
pcc authored
340 add_subdirectory(lib/TableGen)
1d8e4cf CMake build system: support for parallel builds.
Oscar Fuentes authored
341
02516ba CMake: Non-working code for auto-building the native tblgen util when
Oscar Fuentes authored
342 add_subdirectory(utils/TableGen)
343
422fcf3 CMake: Moved generation of Intrinsics.gen to
Oscar Fuentes authored
344 add_subdirectory(include/llvm)
1d8e4cf CMake build system: support for parallel builds.
Oscar Fuentes authored
345
6d857ca Move library stuff out of the toplevel CMakeLists.txt file.
Oscar Fuentes authored
346 add_subdirectory(lib)
e1ad087 CMake: Builds all targets.
Oscar Fuentes authored
347
4d20c24 Build FileCheck from with CMake
Douglas Gregor authored
348 add_subdirectory(utils/FileCheck)
014e189 @Bigcheese CMake: Add FileUpdate to the build.
Bigcheese authored
349 add_subdirectory(utils/FileUpdate)
48f7ce8 @ddunbar Add count/not tools as executables.
ddunbar authored
350 add_subdirectory(utils/count)
351 add_subdirectory(utils/not)
becf392 @Bigcheese CMake: Add llvm-lit to CMake build.
Bigcheese authored
352 add_subdirectory(utils/llvm-lit)
4d20c24 Build FileCheck from with CMake
Douglas Gregor authored
353
5c6bf65 CMake: auto-discover project files under the projects/ subdirectory.
Oscar Fuentes authored
354 add_subdirectory(projects)
3d01fc7 Initial support for the CMake build system.
Oscar Fuentes authored
355
a6c1dbd New cmake options LLVM_INCLUDE_X (X = {TOOLS, EXAMPLES, TESTS}) for
Oscar Fuentes authored
356 if( LLVM_INCLUDE_TOOLS )
357 add_subdirectory(tools)
358 endif()
1dc9716 CMake: `make install' for libraries, executables and header files.
Oscar Fuentes authored
359
e88c724 @nlewycky Add cmakefiles to build profile_rt.so!
nlewycky authored
360 if( LLVM_INCLUDE_RUNTIME )
361 add_subdirectory(runtime)
362 endif()
363
a6c1dbd New cmake options LLVM_INCLUDE_X (X = {TOOLS, EXAMPLES, TESTS}) for
Oscar Fuentes authored
364 if( LLVM_INCLUDE_EXAMPLES )
365 add_subdirectory(examples)
366 endif()
ee6944f @Bigcheese CMake: Build unittests.
Bigcheese authored
367
a6c1dbd New cmake options LLVM_INCLUDE_X (X = {TOOLS, EXAMPLES, TESTS}) for
Oscar Fuentes authored
368 if( LLVM_INCLUDE_TESTS )
369 add_subdirectory(test)
370 add_subdirectory(utils/unittest)
371 add_subdirectory(unittests)
15b337c @chapuni CMake: Build utils/KillTheDoctor only on MSVC for now.
chapuni authored
372 if (MSVC)
bbb9ea7 @Bigcheese Add KillTheDoctor.
Bigcheese authored
373 # This utility is used to prevent chrashing tests from calling Dr. Watson on
374 # Windows.
375 add_subdirectory(utils/KillTheDoctor)
376 endif()
a6c1dbd New cmake options LLVM_INCLUDE_X (X = {TOOLS, EXAMPLES, TESTS}) for
Oscar Fuentes authored
377 endif()
ee6944f @Bigcheese CMake: Build unittests.
Bigcheese authored
378
6252e98 CMake: system for providing llvm-config-like features to the user.
Oscar Fuentes authored
379 add_subdirectory(cmake/modules)
380
1d7c43b Rather than excluding quite some things, and still installing
Oscar Fuentes authored
381 install(DIRECTORY include/
382 DESTINATION include
383 FILES_MATCHING
bc2eb13 CMake: install .def files from source `include/llvm' directory.
Oscar Fuentes authored
384 PATTERN "*.def"
1d7c43b Rather than excluding quite some things, and still installing
Oscar Fuentes authored
385 PATTERN "*.h"
386 PATTERN "*.td"
a2281e7 CMake: Install .inc files too.
Oscar Fuentes authored
387 PATTERN "*.inc"
f67cf01 Install include/llvm/Support/LICENSE.TXT. PR9321.
Oscar Fuentes authored
388 PATTERN "LICENSE.TXT"
1dc9716 CMake: `make install' for libraries, executables and header files.
Oscar Fuentes authored
389 PATTERN ".svn" EXCLUDE
390 )
391
1d7c43b Rather than excluding quite some things, and still installing
Oscar Fuentes authored
392 install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/
393 DESTINATION include
394 FILES_MATCHING
395 PATTERN "*.def"
396 PATTERN "*.h"
397 PATTERN "*.gen"
a2281e7 CMake: Install .inc files too.
Oscar Fuentes authored
398 PATTERN "*.inc"
1d7c43b Rather than excluding quite some things, and still installing
Oscar Fuentes authored
399 # Exclude include/llvm/CMakeFiles/intrinsics_gen.dir, matched by "*.def"
400 PATTERN "CMakeFiles" EXCLUDE
401 PATTERN ".svn" EXCLUDE
1dc9716 CMake: `make install' for libraries, executables and header files.
Oscar Fuentes authored
402 )
403
404 # TODO: make and install documentation.
4d156d3 Added basic support for CPack.
Oscar Fuentes authored
405
406 set(CPACK_PACKAGE_VENDOR "LLVM")
407 set(CPACK_PACKAGE_VERSION_MAJOR 2)
408 set(CPACK_PACKAGE_VERSION_MINOR 9)
409 add_version_info_from_vcs(CPACK_PACKAGE_VERSION_PATCH)
410 include(CPack)
4c8710d @chapuni CMakeLists.txt: On MSVS10, touch LLVM.sln as workaround, w/e project …
chapuni authored
411
412 # Workaround for MSVS10 to avoid the Dialog Hell
413 # FIXME: This could be removed with future version of CMake.
414 if(MSVC_VERSION EQUAL 1600)
415 set(LLVM_SLN_FILENAME "${CMAKE_CURRENT_BINARY_DIR}/LLVM.sln")
416 if( EXISTS "${LLVM_SLN_FILENAME}" )
417 file(APPEND "${LLVM_SLN_FILENAME}" "\n# This should be regenerated!\n")
418 endif()
419 endif()
Something went wrong with that request. Please try again.