PR9081: Split up LDM instruction with deprecated use of both LR and PC.
[oota-llvm.git] / CMakeLists.txt
1 # See docs/CMake.html for instructions about how to build LLVM with CMake.
2
3 project(LLVM)
4 cmake_minimum_required(VERSION 2.8)
5
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
13 set(PACKAGE_VERSION "2.9")
14
15 include(VersionFromVCS)
16
17 option(LLVM_APPEND_VC_REV
18   "Append the version control system revision id to LLVM version" OFF)
19
20 if( LLVM_APPEND_VC_REV )
21   add_version_info_from_vcs(PACKAGE_VERSION)
22 endif()
23
24 set(PACKAGE_NAME llvm)
25 set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
26 set(PACKAGE_BUGREPORT "llvmbugs@cs.uiuc.edu")
27
28 if( CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR AND NOT MSVC_IDE )
29   message(FATAL_ERROR "In-source builds are not allowed.
30 CMake would overwrite the makefiles distributed with LLVM.
31 Please create a directory and run cmake from there, passing the path
32 to this source directory as the last argument.
33 This process created the file `CMakeCache.txt' and the directory `CMakeFiles'.
34 Please delete them.")
35 endif()
36
37 # Run-time build mode; It is used for unittests.
38 if(MSVC_IDE)
39   # Expect "$(Configuration)", "$(OutDir)", etc.
40   # It is expanded by msbuild or similar.
41   set(RUNTIME_BUILD_MODE "${CMAKE_CFG_INTDIR}")
42 elseif(NOT CMAKE_BUILD_TYPE STREQUAL "")
43   # Expect "Release" "Debug", etc.
44   # Or unittests could not run.
45   set(RUNTIME_BUILD_MODE ${CMAKE_BUILD_TYPE})
46 else()
47   # It might be "."
48   set(RUNTIME_BUILD_MODE "${CMAKE_CFG_INTDIR}")
49 endif()
50
51 string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
52
53 set(LLVM_MAIN_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR})
54 set(LLVM_MAIN_INCLUDE_DIR ${LLVM_MAIN_SRC_DIR}/include)
55 set(LLVM_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
56 set(LLVM_TOOLS_BINARY_DIR ${LLVM_BINARY_DIR}/bin)
57 set(LLVM_EXAMPLES_BINARY_DIR ${LLVM_BINARY_DIR}/examples)
58 set(LLVM_LIBDIR_SUFFIX "" CACHE STRING "Define suffix of library directory name (32/64)" )
59
60 if( NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR )
61   file(GLOB_RECURSE
62     tablegenned_files_on_include_dir
63     "${LLVM_MAIN_SRC_DIR}/include/llvm/*.gen")
64   file(GLOB_RECURSE
65     tablegenned_files_on_lib_dir
66     "${LLVM_MAIN_SRC_DIR}/lib/Target/*.inc")
67   if( tablegenned_files_on_include_dir OR tablegenned_files_on_lib_dir)
68     message(FATAL_ERROR "Apparently there is a previous in-source build,
69 probably as the result of running `configure' and `make' on
70 ${LLVM_MAIN_SRC_DIR}.
71 This may cause problems. The suspicious files are:
72 ${tablegenned_files_on_lib_dir}
73 ${tablegenned_files_on_include_dir}
74 Please clean the source directory.")
75   endif()
76 endif()
77
78 set(LLVM_ALL_TARGETS
79   Alpha
80   ARM
81   Blackfin
82   CBackend
83   CellSPU
84   CppBackend
85   Mips
86   MBlaze
87   MSP430
88   PowerPC
89   PTX
90   Sparc
91   SystemZ
92   X86
93   XCore
94   )
95
96 if( MSVC )
97   set(LLVM_TARGETS_TO_BUILD X86
98     CACHE STRING "Semicolon-separated list of targets to build, or \"all\".")
99 else( MSVC )
100   set(LLVM_TARGETS_TO_BUILD ${LLVM_ALL_TARGETS}
101     CACHE STRING "Semicolon-separated list of targets to build, or \"all\".")
102 endif( MSVC )
103
104 set(CLANG_RESOURCE_DIR "" CACHE STRING
105   "Relative directory from the Clang binary to its resource files.")
106
107 option(LLVM_ENABLE_CBE_PRINTF_A "Set to ON if CBE is enabled for printf %a output" ON)
108 if(LLVM_ENABLE_CBE_PRINTF_A)
109   set(ENABLE_CBE_PRINTF_A 1)
110 endif()
111
112 option(LLVM_ENABLE_TIMESTAMPS "Enable embedding timestamp information in build" ON)
113 if(LLVM_ENABLE_TIMESTAMPS)
114   set(ENABLE_TIMESTAMPS 1)
115 endif()
116
117 option(LLVM_ENABLE_FFI "Use libffi to call external functions from the interpreter" OFF)
118 set(FFI_LIBRARY_DIR "" CACHE PATH "Additional directory, where CMake should search for libffi.so")
119 set(FFI_INCLUDE_DIR "" CACHE PATH "Additional directory, where CMake should search for ffi.h or ffi/ffi.h")
120
121 set(C_INCLUDE_DIRS "" CACHE STRING
122   "Colon separated list of directories clang will search for headers.")
123
124 set(LLVM_TARGET_ARCH "host"
125   CACHE STRING "Set target to use for LLVM JIT or use \"host\" for automatic detection.")
126
127 set(LIT_ARGS_DEFAULT "-sv")
128 if (MSVC OR XCODE)
129   set(LIT_ARGS_DEFAULT "${LIT_ARGS_DEFAULT} --no-progress-bar")
130 endif()
131 set(LLVM_LIT_ARGS "${LIT_ARGS_DEFAULT}"
132     CACHE STRING "Default options for lit")
133
134 option(LLVM_ENABLE_THREADS "Use threads if available." ON)
135
136 if( uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE" )
137   option(LLVM_ENABLE_ASSERTIONS "Enable assertions" OFF)
138 else()
139   option(LLVM_ENABLE_ASSERTIONS "Enable assertions" ON)
140 endif()
141
142 if( LLVM_ENABLE_ASSERTIONS )
143   # MSVC doesn't like _DEBUG on release builds. See PR 4379.
144   if( NOT MSVC )
145     add_definitions( -D_DEBUG )
146   endif()
147   # On Release builds cmake automatically defines NDEBUG, so we
148   # explicitly undefine it:
149   if( uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE" )
150     add_definitions( -UNDEBUG )
151   endif()
152 else()
153   if( NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE" )
154     add_definitions( -DNDEBUG )
155   endif()
156 endif()
157
158 if( LLVM_TARGETS_TO_BUILD STREQUAL "all" )
159   set( LLVM_TARGETS_TO_BUILD ${LLVM_ALL_TARGETS} )
160 endif()
161
162 set(LLVM_ENUM_TARGETS "")
163 foreach(c ${LLVM_TARGETS_TO_BUILD})
164   list(FIND LLVM_ALL_TARGETS ${c} idx)
165   if( idx LESS 0 )
166     message(FATAL_ERROR "The target `${c}' does not exist.
167     It should be one of\n${LLVM_ALL_TARGETS}")
168   else()
169     set(LLVM_ENUM_TARGETS "${LLVM_ENUM_TARGETS}LLVM_TARGET(${c})\n")
170   endif()
171 endforeach(c)
172
173 # Produce llvm/Config/Targets.def
174 configure_file(
175   ${LLVM_MAIN_INCLUDE_DIR}/llvm/Config/Targets.def.in
176   ${LLVM_BINARY_DIR}/include/llvm/Config/Targets.def
177   )
178
179 set(llvm_builded_incs_dir ${LLVM_BINARY_DIR}/include/llvm)
180
181 include(AddLLVMDefinitions)
182
183 if(WIN32)
184   if(CYGWIN)
185     set(LLVM_ON_WIN32 0)
186     set(LLVM_ON_UNIX 1)
187   else(CYGWIN)
188     set(LLVM_ON_WIN32 1)
189     set(LLVM_ON_UNIX 0)
190   endif(CYGWIN)
191   set(LTDL_SHLIB_EXT ".dll")
192   set(EXEEXT ".exe")
193   # Maximum path length is 160 for non-unicode paths
194   set(MAXPATHLEN 160)
195 else(WIN32)
196   if(UNIX)
197     set(LLVM_ON_WIN32 0)
198     set(LLVM_ON_UNIX 1)
199     if(APPLE)
200       set(LTDL_SHLIB_EXT ".dylib")
201     else(APPLE)
202       set(LTDL_SHLIB_EXT ".so")
203     endif(APPLE)
204     set(EXEEXT "")
205     # FIXME: Maximum path length is currently set to 'safe' fixed value
206     set(MAXPATHLEN 2024)
207   else(UNIX)
208     MESSAGE(SEND_ERROR "Unable to determine platform")
209   endif(UNIX)
210 endif(WIN32)
211
212 option(LLVM_ENABLE_PIC "Build Position-Independent Code" ON)
213
214 if( LLVM_ENABLE_PIC )
215   if( XCODE )
216     # Xcode has -mdynamic-no-pic on by default, which overrides -fPIC. I don't
217     # know how to disable this, so just force ENABLE_PIC off for now.
218     message(WARNING "-fPIC not supported with Xcode.")
219   elseif( WIN32 )
220     # On Windows all code is PIC. MinGW warns if -fPIC is used.
221   else()
222     include(CheckCXXCompilerFlag)
223     check_cxx_compiler_flag("-fPIC" SUPPORTS_FPIC_FLAG)
224     if( SUPPORTS_FPIC_FLAG )
225       message(STATUS "Building with -fPIC")
226       set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
227       set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
228     else( SUPPORTS_FPIC_FLAG )
229       message(WARNING "-fPIC not supported.")
230     endif()
231   endif()
232 endif()
233
234 include(config-ix)
235
236 set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LLVM_TOOLS_BINARY_DIR} )
237 set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/lib )
238 set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/lib )
239
240 # set(CMAKE_VERBOSE_MAKEFILE true)
241
242 add_llvm_definitions( -D__STDC_LIMIT_MACROS )
243 add_llvm_definitions( -D__STDC_CONSTANT_MACROS )
244
245 # MSVC has a gazillion warnings with this.
246 if( MSVC )
247   option(LLVM_ENABLE_WARNINGS "Enable compiler warnings." OFF)
248 else( MSVC )
249   option(LLVM_ENABLE_WARNINGS "Enable compiler warnings." ON)
250 endif()
251
252 option(LLVM_ENABLE_PEDANTIC "Compile with pedantic enabled." ON)
253 option(LLVM_ENABLE_WERROR "Fail and stop if a warning is triggered." OFF)
254
255 if( CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT WIN32 )
256   # TODO: support other platforms and toolchains.
257   option(LLVM_BUILD_32_BITS "Build 32 bits executables and libraries." OFF)
258   if( LLVM_BUILD_32_BITS )
259     message(STATUS "Building 32 bits executables and libraries.")
260     add_llvm_definitions( -m32 )
261     list(APPEND CMAKE_EXE_LINKER_FLAGS -m32)
262     list(APPEND CMAKE_SHARED_LINKER_FLAGS -m32)
263   endif( LLVM_BUILD_32_BITS )
264 endif( CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT WIN32 )
265
266 if( MSVC )
267   include(ChooseMSVCCRT)
268
269   # Add definitions that make MSVC much less annoying.
270   add_llvm_definitions(
271     # For some reason MS wants to deprecate a bunch of standard functions...
272     -D_CRT_SECURE_NO_DEPRECATE
273     -D_CRT_SECURE_NO_WARNINGS
274     -D_CRT_NONSTDC_NO_DEPRECATE
275     -D_CRT_NONSTDC_NO_WARNINGS
276     -D_SCL_SECURE_NO_DEPRECATE
277     -D_SCL_SECURE_NO_WARNINGS
278
279     -wd4146 # Suppress 'unary minus operator applied to unsigned type, result still unsigned'
280     -wd4180 # Suppress 'qualifier applied to function type has no meaning; ignored'
281     -wd4224 # Suppress 'nonstandard extension used : formal parameter 'identifier' was previously defined as a type'
282     -wd4244 # Suppress ''argument' : conversion from 'type1' to 'type2', possible loss of data'
283     -wd4267 # Suppress ''var' : conversion from 'size_t' to 'type', possible loss of data'
284     -wd4275 # Suppress 'An exported class was derived from a class that was not exported.'
285     -wd4291 # Suppress ''declaration' : no matching operator delete found; memory will not be freed if initialization throws an exception'
286     -wd4345 # Suppress 'behavior change: an object of POD type constructed with an initializer of the form () will be default-initialized'
287     -wd4351 # Suppress 'new behavior: elements of array 'array' will be default initialized'
288     -wd4355 # Suppress ''this' : used in base member initializer list'
289     -wd4503 # Suppress ''identifier' : decorated name length exceeded, name was truncated'
290     -wd4624 # Suppress ''derived class' : destructor could not be generated because a base class destructor is inaccessible'
291     -wd4715 # Suppress ''function' : not all control paths return a value'
292     -wd4800 # Suppress ''type' : forcing value to bool 'true' or 'false' (performance warning)'
293     -wd4065 # Suppress 'switch statement contains 'default' but no 'case' labels'
294
295     -w14062 # Promote "enumerator in switch of enum is not handled" to level 1 warning.
296     )
297
298   # Enable warnings
299   if (LLVM_ENABLE_WARNINGS)
300     add_llvm_definitions( /W4 /Wall )
301     if (LLVM_ENABLE_PEDANTIC)
302       # No MSVC equivalent available
303     endif (LLVM_ENABLE_PEDANTIC)
304   endif (LLVM_ENABLE_WARNINGS)
305   if (LLVM_ENABLE_WERROR)
306     add_llvm_definitions( /WX )
307   endif (LLVM_ENABLE_WERROR)
308 elseif( CMAKE_COMPILER_IS_GNUCXX )
309   if (LLVM_ENABLE_WARNINGS)
310     add_llvm_definitions( -Wall -W -Wno-unused-parameter -Wwrite-strings )
311     if (LLVM_ENABLE_PEDANTIC)
312       add_llvm_definitions( -pedantic -Wno-long-long )
313     endif (LLVM_ENABLE_PEDANTIC)
314   endif (LLVM_ENABLE_WARNINGS)
315   if (LLVM_ENABLE_WERROR)
316     add_llvm_definitions( -Werror )
317   endif (LLVM_ENABLE_WERROR)
318 endif( MSVC )
319
320 include_directories( ${LLVM_BINARY_DIR}/include ${LLVM_MAIN_INCLUDE_DIR})
321
322 if( ${CMAKE_SYSTEM_NAME} MATCHES SunOS )
323    SET(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-include llvm/Support/Solaris.h")
324 endif( ${CMAKE_SYSTEM_NAME} MATCHES SunOS )
325
326 include(AddLLVM)
327 include(TableGen)
328
329 if( MINGW )
330   get_system_libs(LLVM_SYSTEM_LIBS_LIST)
331   foreach(l ${LLVM_SYSTEM_LIBS_LIST})
332     set(LLVM_SYSTEM_LIBS "${LLVM_SYSTEM_LIBS} -l${l}")
333   endforeach()
334   set(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES}${LLVM_SYSTEM_LIBS}")
335   set(CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES}${LLVM_SYSTEM_LIBS}")
336 endif()
337
338 if( MINGW )
339   # People report that -O3 is unreliable on MinGW. The traditional
340   # build also uses -O2 for that reason:
341   llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O2")
342 endif()
343
344 add_subdirectory(lib/Support)
345
346 # Everything else depends on Support:
347 set(LLVM_COMMON_DEPENDS ${LLVM_COMMON_DEPENDS} ${LLVM_LIBS} )
348
349 set(LLVM_TABLEGEN "tblgen" CACHE
350   STRING "Native TableGen executable. Saves building one when cross-compiling.")
351 # Effective tblgen executable to be used:
352 set(LLVM_TABLEGEN_EXE ${LLVM_TABLEGEN})
353
354 add_subdirectory(utils/TableGen)
355
356 if( CMAKE_CROSSCOMPILING )
357   # This adds a dependency on target `tblgen', so must go after utils/TableGen
358   include( CrossCompileLLVM )
359 endif( CMAKE_CROSSCOMPILING )
360
361 add_subdirectory(include/llvm)
362
363 add_subdirectory(lib/VMCore)
364 add_subdirectory(lib/CodeGen)
365 add_subdirectory(lib/CodeGen/SelectionDAG)
366 add_subdirectory(lib/CodeGen/AsmPrinter)
367 add_subdirectory(lib/Bitcode/Reader)
368 add_subdirectory(lib/Bitcode/Writer)
369 add_subdirectory(lib/Transforms/Utils)
370 add_subdirectory(lib/Transforms/Instrumentation)
371 add_subdirectory(lib/Transforms/InstCombine)
372 add_subdirectory(lib/Transforms/Scalar)
373 add_subdirectory(lib/Transforms/IPO)
374 add_subdirectory(lib/Transforms/Hello)
375 add_subdirectory(lib/Linker)
376 add_subdirectory(lib/Analysis)
377 add_subdirectory(lib/Analysis/IPA)
378 add_subdirectory(lib/MC)
379 add_subdirectory(lib/MC/MCParser)
380 add_subdirectory(lib/MC/MCDisassembler)
381 add_subdirectory(lib/Object)
382
383 add_subdirectory(utils/FileCheck)
384 add_subdirectory(utils/FileUpdate)
385 add_subdirectory(utils/count)
386 add_subdirectory(utils/not)
387 add_subdirectory(utils/llvm-lit)
388
389 set(LLVM_ENUM_ASM_PRINTERS "")
390 set(LLVM_ENUM_ASM_PARSERS "")
391 set(LLVM_ENUM_DISASSEMBLERS "")
392 foreach(t ${LLVM_TARGETS_TO_BUILD})
393   message(STATUS "Targeting ${t}")
394   add_subdirectory(lib/Target/${t})
395   add_subdirectory(lib/Target/${t}/TargetInfo)
396   set( td ${LLVM_MAIN_SRC_DIR}/lib/Target/${t} )
397   file(GLOB asmp_file "${td}/*AsmPrinter.cpp")
398   if( asmp_file )
399     set(LLVM_ENUM_ASM_PRINTERS
400       "${LLVM_ENUM_ASM_PRINTERS}LLVM_ASM_PRINTER(${t})\n")
401   endif()
402   if( EXISTS ${td}/InstPrinter/CMakeLists.txt )
403     add_subdirectory(lib/Target/${t}/InstPrinter)
404   endif()
405   if( EXISTS ${td}/AsmParser/CMakeLists.txt )
406     add_subdirectory(lib/Target/${t}/AsmParser)
407     set(LLVM_ENUM_ASM_PARSERS
408       "${LLVM_ENUM_ASM_PARSERS}LLVM_ASM_PARSER(${t})\n")
409   endif()
410   if( EXISTS ${td}/Disassembler/CMakeLists.txt )
411     add_subdirectory(lib/Target/${t}/Disassembler)
412     set(LLVM_ENUM_DISASSEMBLERS
413       "${LLVM_ENUM_DISASSEMBLERS}LLVM_DISASSEMBLER(${t})\n")
414   endif()
415   set(CURRENT_LLVM_TARGET)
416 endforeach(t)
417
418 # Produce llvm/Config/AsmPrinters.def
419 configure_file(
420   ${LLVM_MAIN_INCLUDE_DIR}/llvm/Config/AsmPrinters.def.in
421   ${LLVM_BINARY_DIR}/include/llvm/Config/AsmPrinters.def
422   )
423
424 # Produce llvm/Config/AsmParsers.def
425 configure_file(
426   ${LLVM_MAIN_INCLUDE_DIR}/llvm/Config/AsmParsers.def.in
427   ${LLVM_BINARY_DIR}/include/llvm/Config/AsmParsers.def
428   )
429
430 # Produce llvm/Config/Disassemblers.def
431 configure_file(
432   ${LLVM_MAIN_INCLUDE_DIR}/llvm/Config/Disassemblers.def.in
433   ${LLVM_BINARY_DIR}/include/llvm/Config/Disassemblers.def
434   )
435
436 add_subdirectory(lib/ExecutionEngine)
437 add_subdirectory(lib/ExecutionEngine/Interpreter)
438 add_subdirectory(lib/ExecutionEngine/JIT)
439 add_subdirectory(lib/ExecutionEngine/MCJIT)
440 add_subdirectory(lib/Target)
441 add_subdirectory(lib/AsmParser)
442 add_subdirectory(lib/Archive)
443
444 add_subdirectory(projects)
445
446 option(LLVM_BUILD_TOOLS
447   "Build the LLVM tools. If OFF, just generate build targets." ON)
448 option(LLVM_INCLUDE_TOOLS "Generate build targets for the LLVM tools." ON)
449 if( LLVM_INCLUDE_TOOLS )
450   add_subdirectory(tools)
451 endif()
452
453 option(LLVM_BUILD_EXAMPLES
454   "Build the LLVM example programs. If OFF, just generate build targets." OFF)
455 option(LLVM_INCLUDE_EXAMPLES "Generate build targets for the LLVM examples" ON)
456 if( LLVM_INCLUDE_EXAMPLES )
457   add_subdirectory(examples)
458 endif()
459
460 option(LLVM_BUILD_TESTS
461   "Build LLVM unit tests. If OFF, just generate build targes." OFF)
462 option(LLVM_INCLUDE_TESTS "Generate build targets for the LLVM unit tests." ON)
463 if( LLVM_INCLUDE_TESTS )
464   add_subdirectory(test)
465   add_subdirectory(utils/unittest)
466   add_subdirectory(unittests)
467   if (MSVC)
468     # This utility is used to prevent chrashing tests from calling Dr. Watson on
469     # Windows.
470     add_subdirectory(utils/KillTheDoctor)
471   endif()
472 endif()
473
474 add_subdirectory(cmake/modules)
475
476 install(DIRECTORY include/
477   DESTINATION include
478   FILES_MATCHING
479   PATTERN "*.def"
480   PATTERN "*.h"
481   PATTERN "*.td"
482   PATTERN "*.inc"
483   PATTERN ".svn" EXCLUDE
484   )
485
486 install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/
487   DESTINATION include
488   FILES_MATCHING
489   PATTERN "*.def"
490   PATTERN "*.h"
491   PATTERN "*.gen"
492   PATTERN "*.inc"
493   # Exclude include/llvm/CMakeFiles/intrinsics_gen.dir, matched by "*.def"
494   PATTERN "CMakeFiles" EXCLUDE
495   PATTERN ".svn" EXCLUDE
496   )
497
498 # TODO: make and install documentation.
499
500 set(CPACK_PACKAGE_VENDOR "LLVM")
501 set(CPACK_PACKAGE_VERSION_MAJOR 2)
502 set(CPACK_PACKAGE_VERSION_MINOR 9)
503 add_version_info_from_vcs(CPACK_PACKAGE_VERSION_PATCH)
504 include(CPack)
505
506 # Workaround for MSVS10 to avoid the Dialog Hell
507 # FIXME: This could be removed with future version of CMake.
508 if(MSVC_VERSION EQUAL 1600)
509   set(LLVM_SLN_FILENAME "${CMAKE_CURRENT_BINARY_DIR}/LLVM.sln")
510   if( EXISTS "${LLVM_SLN_FILENAME}" )
511     file(APPEND "${LLVM_SLN_FILENAME}" "\n# This should be regenerated!\n")
512   endif()
513 endif()