| Oscar Fuentes | 34fc517 | 2009-04-04 22:52:02 +0000 | [diff] [blame] | 1 | # See docs/CMake.html for instructions about how to build LLVM with CMake. |
| 2 | |
| Cedric Venet | 1d083f4 | 2008-10-30 21:22:00 +0000 | [diff] [blame] | 3 | project(LLVM) |
| Oscar Fuentes | c677c5d | 2010-08-03 15:07:17 +0000 | [diff] [blame] | 4 | cmake_minimum_required(VERSION 2.8) |
| Oscar Fuentes | 3d01fc7 | 2008-09-22 01:08:49 +0000 | [diff] [blame] | 5 | |
| Oscar Fuentes | ee99317 | 2010-08-03 17:28:09 +0000 | [diff] [blame] | 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 | |
| Douglas Gregor | 6b5db95 | 2010-09-23 14:19:21 +0000 | [diff] [blame] | 13 | set(PACKAGE_VERSION "2.9") |
| Oscar Fuentes | 784a176 | 2010-12-20 09:47:13 +0000 | [diff] [blame] | 14 | |
| Oscar Fuentes | ee99317 | 2010-08-03 17:28:09 +0000 | [diff] [blame] | 15 | include(VersionFromVCS) |
| Oscar Fuentes | 784a176 | 2010-12-20 09:47:13 +0000 | [diff] [blame] | 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() |
| Oscar Fuentes | ee99317 | 2010-08-03 17:28:09 +0000 | [diff] [blame] | 23 | |
| Oscar Fuentes | 3d01fc7 | 2008-09-22 01:08:49 +0000 | [diff] [blame] | 24 | set(PACKAGE_NAME llvm) |
| Chris Lattner | 8c46e85 | 2009-01-28 17:49:03 +0000 | [diff] [blame] | 25 | set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") |
| Oscar Fuentes | f7e73b9 | 2008-10-25 03:49:35 +0000 | [diff] [blame] | 26 | set(PACKAGE_BUGREPORT "llvmbugs@cs.uiuc.edu") |
| Oscar Fuentes | 3d01fc7 | 2008-09-22 01:08:49 +0000 | [diff] [blame] | 27 | |
| Oscar Fuentes | 6326a0d | 2008-11-14 03:43:18 +0000 | [diff] [blame] | 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 | |
| NAKAMURA Takumi | d420e7b | 2010-11-27 13:10:11 +0000 | [diff] [blame] | 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 | |
| Oscar Fuentes | 81a8755 | 2009-06-03 15:11:25 +0000 | [diff] [blame] | 51 | string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE) |
| 52 | |
| Oscar Fuentes | 3d01fc7 | 2008-09-22 01:08:49 +0000 | [diff] [blame] | 53 | set(LLVM_MAIN_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}) |
| Oscar Fuentes | 980e842 | 2008-10-29 02:33:15 +0000 | [diff] [blame] | 54 | set(LLVM_MAIN_INCLUDE_DIR ${LLVM_MAIN_SRC_DIR}/include) |
| Oscar Fuentes | 3d01fc7 | 2008-09-22 01:08:49 +0000 | [diff] [blame] | 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) |
| Oscar Fuentes | af0f65f | 2009-06-12 02:49:53 +0000 | [diff] [blame] | 58 | set(LLVM_LIBDIR_SUFFIX "" CACHE STRING "Define suffix of library directory name (32/64)" ) |
| Oscar Fuentes | 3d01fc7 | 2008-09-22 01:08:49 +0000 | [diff] [blame] | 59 | |
| Oscar Fuentes | 6761c5d | 2009-07-13 21:58:44 +0000 | [diff] [blame] | 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 | |
| Oscar Fuentes | 4f21c13 | 2008-11-10 01:47:07 +0000 | [diff] [blame] | 78 | set(LLVM_ALL_TARGETS |
| 79 | Alpha |
| 80 | ARM |
| Jakob Stoklund Olesen | 73b7bb7 | 2009-08-02 17:32:37 +0000 | [diff] [blame] | 81 | Blackfin |
| Oscar Fuentes | 4f21c13 | 2008-11-10 01:47:07 +0000 | [diff] [blame] | 82 | CBackend |
| 83 | CellSPU |
| 84 | CppBackend |
| Oscar Fuentes | 4f21c13 | 2008-11-10 01:47:07 +0000 | [diff] [blame] | 85 | Mips |
| Wesley Peck | c84a956 | 2010-03-05 15:15:55 +0000 | [diff] [blame] | 86 | MBlaze |
| Richard Pennington | a51984b | 2009-07-09 20:27:09 +0000 | [diff] [blame] | 87 | MSP430 |
| Oscar Fuentes | 4f21c13 | 2008-11-10 01:47:07 +0000 | [diff] [blame] | 88 | PowerPC |
| Oscar Fuentes | b2c70cf | 2010-09-28 14:02:36 +0000 | [diff] [blame] | 89 | PTX |
| Oscar Fuentes | 4f21c13 | 2008-11-10 01:47:07 +0000 | [diff] [blame] | 90 | Sparc |
| Daniel Dunbar | 3f189a3 | 2009-07-20 00:24:17 +0000 | [diff] [blame] | 91 | SystemZ |
| Oscar Fuentes | 4f21c13 | 2008-11-10 01:47:07 +0000 | [diff] [blame] | 92 | X86 |
| 93 | XCore |
| 94 | ) |
| 95 | |
| Oscar Fuentes | e1ad087 | 2008-09-26 04:40:32 +0000 | [diff] [blame] | 96 | if( MSVC ) |
| 97 | set(LLVM_TARGETS_TO_BUILD X86 |
| Oscar Fuentes | 4f21c13 | 2008-11-10 01:47:07 +0000 | [diff] [blame] | 98 | CACHE STRING "Semicolon-separated list of targets to build, or \"all\".") |
| Oscar Fuentes | e1ad087 | 2008-09-26 04:40:32 +0000 | [diff] [blame] | 99 | else( MSVC ) |
| Oscar Fuentes | 4f21c13 | 2008-11-10 01:47:07 +0000 | [diff] [blame] | 100 | set(LLVM_TARGETS_TO_BUILD ${LLVM_ALL_TARGETS} |
| 101 | CACHE STRING "Semicolon-separated list of targets to build, or \"all\".") |
| Oscar Fuentes | e1ad087 | 2008-09-26 04:40:32 +0000 | [diff] [blame] | 102 | endif( MSVC ) |
| Oscar Fuentes | 3d01fc7 | 2008-09-22 01:08:49 +0000 | [diff] [blame] | 103 | |
| Chandler Carruth | 6b24116 | 2010-10-19 08:21:25 +0000 | [diff] [blame] | 104 | set(CLANG_RESOURCE_DIR "" CACHE STRING |
| 105 | "Relative directory from the Clang binary to its resource files.") |
| 106 | |
| Oscar Fuentes | 19823b1 | 2011-01-11 12:31:54 +0000 | [diff] [blame] | 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 | |
| Oscar Fuentes | 8e3c169 | 2009-11-12 06:48:09 +0000 | [diff] [blame] | 117 | set(C_INCLUDE_DIRS "" CACHE STRING |
| 118 | "Colon separated list of directories clang will search for headers.") |
| 119 | |
| Oscar Fuentes | a9ff139 | 2009-09-13 22:18:38 +0000 | [diff] [blame] | 120 | set(LLVM_TARGET_ARCH "host" |
| 121 | CACHE STRING "Set target to use for LLVM JIT or use \"host\" for automatic detection.") |
| 122 | |
| NAKAMURA Takumi | e7ae70b | 2010-11-11 04:09:35 +0000 | [diff] [blame] | 123 | set(LIT_ARGS_DEFAULT "-sv") |
| 124 | if (MSVC OR XCODE) |
| 125 | set(LIT_ARGS_DEFAULT "${LIT_ARGS_DEFAULT} --no-progress-bar") |
| 126 | endif() |
| 127 | set(LLVM_LIT_ARGS "${LIT_ARGS_DEFAULT}" |
| 128 | CACHE STRING "Default options for lit") |
| 129 | |
| Oscar Fuentes | 4b44283 | 2008-11-18 23:45:21 +0000 | [diff] [blame] | 130 | option(LLVM_ENABLE_THREADS "Use threads if available." ON) |
| 131 | |
| Oscar Fuentes | 81a8755 | 2009-06-03 15:11:25 +0000 | [diff] [blame] | 132 | if( uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE" ) |
| Oscar Fuentes | 76941b2 | 2009-06-04 09:26:16 +0000 | [diff] [blame] | 133 | option(LLVM_ENABLE_ASSERTIONS "Enable assertions" OFF) |
| Oscar Fuentes | 81a8755 | 2009-06-03 15:11:25 +0000 | [diff] [blame] | 134 | else() |
| Oscar Fuentes | 76941b2 | 2009-06-04 09:26:16 +0000 | [diff] [blame] | 135 | option(LLVM_ENABLE_ASSERTIONS "Enable assertions" ON) |
| Oscar Fuentes | 81a8755 | 2009-06-03 15:11:25 +0000 | [diff] [blame] | 136 | endif() |
| 137 | |
| Oscar Fuentes | 76941b2 | 2009-06-04 09:26:16 +0000 | [diff] [blame] | 138 | if( LLVM_ENABLE_ASSERTIONS ) |
| Oscar Fuentes | af10910 | 2009-07-05 18:43:52 +0000 | [diff] [blame] | 139 | # MSVC doesn't like _DEBUG on release builds. See PR 4379. |
| Oscar Fuentes | e8c81ea | 2009-07-05 23:58:20 +0000 | [diff] [blame] | 140 | if( NOT MSVC ) |
| Oscar Fuentes | af10910 | 2009-07-05 18:43:52 +0000 | [diff] [blame] | 141 | add_definitions( -D_DEBUG ) |
| 142 | endif() |
| Oscar Fuentes | 76941b2 | 2009-06-04 09:26:16 +0000 | [diff] [blame] | 143 | # On Release builds cmake automatically defines NDEBUG, so we |
| 144 | # explicitly undefine it: |
| 145 | if( uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE" ) |
| 146 | add_definitions( -UNDEBUG ) |
| 147 | endif() |
| 148 | else() |
| 149 | if( NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE" ) |
| 150 | add_definitions( -DNDEBUG ) |
| 151 | endif() |
| Oscar Fuentes | 81a8755 | 2009-06-03 15:11:25 +0000 | [diff] [blame] | 152 | endif() |
| 153 | |
| Oscar Fuentes | 4f21c13 | 2008-11-10 01:47:07 +0000 | [diff] [blame] | 154 | if( LLVM_TARGETS_TO_BUILD STREQUAL "all" ) |
| 155 | set( LLVM_TARGETS_TO_BUILD ${LLVM_ALL_TARGETS} ) |
| 156 | endif() |
| 157 | |
| Douglas Gregor | 1555a23 | 2009-06-16 20:12:29 +0000 | [diff] [blame] | 158 | set(LLVM_ENUM_TARGETS "") |
| Oscar Fuentes | 4f21c13 | 2008-11-10 01:47:07 +0000 | [diff] [blame] | 159 | foreach(c ${LLVM_TARGETS_TO_BUILD}) |
| 160 | list(FIND LLVM_ALL_TARGETS ${c} idx) |
| 161 | if( idx LESS 0 ) |
| Gabor Greif | 9befba8 | 2009-08-12 08:37:37 +0000 | [diff] [blame] | 162 | message(FATAL_ERROR "The target `${c}' does not exist. |
| Oscar Fuentes | 4f21c13 | 2008-11-10 01:47:07 +0000 | [diff] [blame] | 163 | It should be one of\n${LLVM_ALL_TARGETS}") |
| Douglas Gregor | 1555a23 | 2009-06-16 20:12:29 +0000 | [diff] [blame] | 164 | else() |
| 165 | set(LLVM_ENUM_TARGETS "${LLVM_ENUM_TARGETS}LLVM_TARGET(${c})\n") |
| Oscar Fuentes | 4f21c13 | 2008-11-10 01:47:07 +0000 | [diff] [blame] | 166 | endif() |
| 167 | endforeach(c) |
| 168 | |
| Douglas Gregor | 1555a23 | 2009-06-16 20:12:29 +0000 | [diff] [blame] | 169 | # Produce llvm/Config/Targets.def |
| 170 | configure_file( |
| 171 | ${LLVM_MAIN_INCLUDE_DIR}/llvm/Config/Targets.def.in |
| 172 | ${LLVM_BINARY_DIR}/include/llvm/Config/Targets.def |
| 173 | ) |
| 174 | |
| Oscar Fuentes | 3d01fc7 | 2008-09-22 01:08:49 +0000 | [diff] [blame] | 175 | set(llvm_builded_incs_dir ${LLVM_BINARY_DIR}/include/llvm) |
| 176 | |
| Oscar Fuentes | 9a0107d | 2009-04-04 22:41:07 +0000 | [diff] [blame] | 177 | include(AddLLVMDefinitions) |
| 178 | |
| Oscar Fuentes | 3d01fc7 | 2008-09-22 01:08:49 +0000 | [diff] [blame] | 179 | if(WIN32) |
| Oscar Fuentes | 4fd38b8 | 2008-10-30 17:15:54 +0000 | [diff] [blame] | 180 | if(CYGWIN) |
| 181 | set(LLVM_ON_WIN32 0) |
| 182 | set(LLVM_ON_UNIX 1) |
| 183 | else(CYGWIN) |
| 184 | set(LLVM_ON_WIN32 1) |
| 185 | set(LLVM_ON_UNIX 0) |
| 186 | endif(CYGWIN) |
| Oscar Fuentes | 3d01fc7 | 2008-09-22 01:08:49 +0000 | [diff] [blame] | 187 | set(LTDL_SHLIB_EXT ".dll") |
| 188 | set(EXEEXT ".exe") |
| 189 | # Maximum path length is 160 for non-unicode paths |
| 190 | set(MAXPATHLEN 160) |
| 191 | else(WIN32) |
| 192 | if(UNIX) |
| 193 | set(LLVM_ON_WIN32 0) |
| 194 | set(LLVM_ON_UNIX 1) |
| Daniel Dunbar | 05dafd8 | 2009-09-22 06:09:37 +0000 | [diff] [blame] | 195 | if(APPLE) |
| 196 | set(LTDL_SHLIB_EXT ".dylib") |
| 197 | else(APPLE) |
| 198 | set(LTDL_SHLIB_EXT ".so") |
| 199 | endif(APPLE) |
| Oscar Fuentes | 3d01fc7 | 2008-09-22 01:08:49 +0000 | [diff] [blame] | 200 | set(EXEEXT "") |
| 201 | # FIXME: Maximum path length is currently set to 'safe' fixed value |
| 202 | set(MAXPATHLEN 2024) |
| 203 | else(UNIX) |
| 204 | MESSAGE(SEND_ERROR "Unable to determine platform") |
| 205 | endif(UNIX) |
| 206 | endif(WIN32) |
| 207 | |
| Oscar Fuentes | 1e02bf0 | 2009-08-18 15:29:35 +0000 | [diff] [blame] | 208 | option(LLVM_ENABLE_PIC "Build Position-Independent Code" ON) |
| Oscar Fuentes | 64fb4c8 | 2008-11-20 19:13:51 +0000 | [diff] [blame] | 209 | |
| 210 | if( LLVM_ENABLE_PIC ) |
| Oscar Fuentes | 2c5e0b8 | 2011-01-09 14:34:39 +0000 | [diff] [blame] | 211 | if( XCODE ) |
| 212 | # Xcode has -mdynamic-no-pic on by default, which overrides -fPIC. I don't |
| 213 | # know how to disable this, so just force ENABLE_PIC off for now. |
| 214 | message(WARNING "-fPIC not supported with Xcode.") |
| 215 | elseif( WIN32 ) |
| 216 | # On Windows all code is PIC. MinGW warns if -fPIC is used. |
| 217 | else() |
| 218 | include(CheckCXXCompilerFlag) |
| 219 | check_cxx_compiler_flag("-fPIC" SUPPORTS_FPIC_FLAG) |
| 220 | if( SUPPORTS_FPIC_FLAG ) |
| Daniel Dunbar | 3620618 | 2009-11-08 00:34:22 +0000 | [diff] [blame] | 221 | message(STATUS "Building with -fPIC") |
| Oscar Fuentes | 2c5e0b8 | 2011-01-09 14:34:39 +0000 | [diff] [blame] | 222 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") |
| Oscar Fuentes | 6abea2b | 2011-01-09 17:38:31 +0000 | [diff] [blame] | 223 | set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") |
| Oscar Fuentes | 2c5e0b8 | 2011-01-09 14:34:39 +0000 | [diff] [blame] | 224 | else( SUPPORTS_FPIC_FLAG ) |
| 225 | message(WARNING "-fPIC not supported.") |
| 226 | endif() |
| 227 | endif() |
| Oscar Fuentes | 64fb4c8 | 2008-11-20 19:13:51 +0000 | [diff] [blame] | 228 | endif() |
| 229 | |
| Oscar Fuentes | 2c5e0b8 | 2011-01-09 14:34:39 +0000 | [diff] [blame] | 230 | include(config-ix) |
| 231 | |
| Oscar Fuentes | 3d01fc7 | 2008-09-22 01:08:49 +0000 | [diff] [blame] | 232 | set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LLVM_TOOLS_BINARY_DIR} ) |
| 233 | set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/lib ) |
| 234 | set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/lib ) |
| 235 | |
| 236 | # set(CMAKE_VERBOSE_MAKEFILE true) |
| 237 | |
| Oscar Fuentes | 9a0107d | 2009-04-04 22:41:07 +0000 | [diff] [blame] | 238 | add_llvm_definitions( -D__STDC_LIMIT_MACROS ) |
| 239 | add_llvm_definitions( -D__STDC_CONSTANT_MACROS ) |
| Oscar Fuentes | 3d01fc7 | 2008-09-22 01:08:49 +0000 | [diff] [blame] | 240 | |
| Daniel Dunbar | 9ea3a2c | 2009-12-01 19:11:36 +0000 | [diff] [blame] | 241 | # MSVC has a gazillion warnings with this. |
| 242 | if( MSVC ) |
| 243 | option(LLVM_ENABLE_WARNINGS "Enable compiler warnings." OFF) |
| 244 | else( MSVC ) |
| 245 | option(LLVM_ENABLE_WARNINGS "Enable compiler warnings." ON) |
| 246 | endif() |
| 247 | |
| Oscar Fuentes | f12a900 | 2009-12-01 02:21:51 +0000 | [diff] [blame] | 248 | option(LLVM_ENABLE_PEDANTIC "Compile with pedantic enabled." ON) |
| 249 | option(LLVM_ENABLE_WERROR "Fail and stop if a warning is triggered." OFF) |
| 250 | |
| Oscar Fuentes | b0c5699 | 2008-11-04 03:27:24 +0000 | [diff] [blame] | 251 | if( CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT WIN32 ) |
| 252 | # TODO: support other platforms and toolchains. |
| Oscar Fuentes | 6307b94 | 2008-11-19 00:10:39 +0000 | [diff] [blame] | 253 | option(LLVM_BUILD_32_BITS "Build 32 bits executables and libraries." OFF) |
| 254 | if( LLVM_BUILD_32_BITS ) |
| Oscar Fuentes | b0c5699 | 2008-11-04 03:27:24 +0000 | [diff] [blame] | 255 | message(STATUS "Building 32 bits executables and libraries.") |
| Oscar Fuentes | 9a0107d | 2009-04-04 22:41:07 +0000 | [diff] [blame] | 256 | add_llvm_definitions( -m32 ) |
| Oscar Fuentes | 6307b94 | 2008-11-19 00:10:39 +0000 | [diff] [blame] | 257 | list(APPEND CMAKE_EXE_LINKER_FLAGS -m32) |
| 258 | list(APPEND CMAKE_SHARED_LINKER_FLAGS -m32) |
| Oscar Fuentes | 6307b94 | 2008-11-19 00:10:39 +0000 | [diff] [blame] | 259 | endif( LLVM_BUILD_32_BITS ) |
| Oscar Fuentes | b0c5699 | 2008-11-04 03:27:24 +0000 | [diff] [blame] | 260 | endif( CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT WIN32 ) |
| 261 | |
| Oscar Fuentes | 3d01fc7 | 2008-09-22 01:08:49 +0000 | [diff] [blame] | 262 | if( MSVC ) |
| Oscar Fuentes | 02a8f76 | 2010-08-05 01:25:48 +0000 | [diff] [blame] | 263 | include(ChooseMSVCCRT) |
| Stefanus Du Toit | 4ba3a0e | 2009-06-08 21:18:31 +0000 | [diff] [blame] | 264 | |
| Michael J. Spencer | 57e9104 | 2010-12-18 00:18:58 +0000 | [diff] [blame] | 265 | # Add definitions that make MSVC much less annoying. |
| 266 | add_llvm_definitions( |
| 267 | # For some reason MS wants to deprecate a bunch of standard functions... |
| 268 | -D_CRT_SECURE_NO_DEPRECATE |
| 269 | -D_CRT_SECURE_NO_WARNINGS |
| 270 | -D_CRT_NONSTDC_NO_DEPRECATE |
| 271 | -D_CRT_NONSTDC_NO_WARNINGS |
| 272 | -D_SCL_SECURE_NO_DEPRECATE |
| 273 | -D_SCL_SECURE_NO_WARNINGS |
| Stefanus Du Toit | 4ba3a0e | 2009-06-08 21:18:31 +0000 | [diff] [blame] | 274 | |
| Michael J. Spencer | 57e9104 | 2010-12-18 00:18:58 +0000 | [diff] [blame] | 275 | -wd4146 # Suppress 'unary minus operator applied to unsigned type, result still unsigned' |
| 276 | -wd4180 # Suppress 'qualifier applied to function type has no meaning; ignored' |
| 277 | -wd4224 # Suppress 'nonstandard extension used : formal parameter 'identifier' was previously defined as a type' |
| 278 | -wd4244 # Suppress ''argument' : conversion from 'type1' to 'type2', possible loss of data' |
| 279 | -wd4267 # Suppress ''var' : conversion from 'size_t' to 'type', possible loss of data' |
| 280 | -wd4275 # Suppress 'An exported class was derived from a class that was not exported.' |
| 281 | -wd4291 # Suppress ''declaration' : no matching operator delete found; memory will not be freed if initialization throws an exception' |
| 282 | -wd4345 # Suppress 'behavior change: an object of POD type constructed with an initializer of the form () will be default-initialized' |
| 283 | -wd4351 # Suppress 'new behavior: elements of array 'array' will be default initialized' |
| 284 | -wd4355 # Suppress ''this' : used in base member initializer list' |
| 285 | -wd4503 # Suppress ''identifier' : decorated name length exceeded, name was truncated' |
| 286 | -wd4624 # Suppress ''derived class' : destructor could not be generated because a base class destructor is inaccessible' |
| 287 | -wd4715 # Suppress ''function' : not all control paths return a value' |
| 288 | -wd4800 # Suppress ''type' : forcing value to bool 'true' or 'false' (performance warning)' |
| 289 | |
| 290 | -w14062 # Promote "enumerator in switch of enum is not handled" to level 1 warning. |
| 291 | ) |
| Daniel Dunbar | 2c4df5a | 2009-07-19 01:35:10 +0000 | [diff] [blame] | 292 | |
| Oscar Fuentes | f12a900 | 2009-12-01 02:21:51 +0000 | [diff] [blame] | 293 | # Enable warnings |
| 294 | if (LLVM_ENABLE_WARNINGS) |
| 295 | add_llvm_definitions( /W4 /Wall ) |
| 296 | if (LLVM_ENABLE_PEDANTIC) |
| 297 | # No MSVC equivalent available |
| 298 | endif (LLVM_ENABLE_PEDANTIC) |
| 299 | endif (LLVM_ENABLE_WARNINGS) |
| 300 | if (LLVM_ENABLE_WERROR) |
| 301 | add_llvm_definitions( /WX ) |
| 302 | endif (LLVM_ENABLE_WERROR) |
| Oscar Fuentes | 2343b10 | 2009-11-30 23:50:14 +0000 | [diff] [blame] | 303 | elseif( CMAKE_COMPILER_IS_GNUCXX ) |
| Oscar Fuentes | f12a900 | 2009-12-01 02:21:51 +0000 | [diff] [blame] | 304 | if (LLVM_ENABLE_WARNINGS) |
| 305 | add_llvm_definitions( -Wall -W -Wno-unused-parameter -Wwrite-strings ) |
| 306 | if (LLVM_ENABLE_PEDANTIC) |
| 307 | add_llvm_definitions( -pedantic -Wno-long-long ) |
| 308 | endif (LLVM_ENABLE_PEDANTIC) |
| 309 | endif (LLVM_ENABLE_WARNINGS) |
| 310 | if (LLVM_ENABLE_WERROR) |
| 311 | add_llvm_definitions( -Werror ) |
| 312 | endif (LLVM_ENABLE_WERROR) |
| Oscar Fuentes | 3d01fc7 | 2008-09-22 01:08:49 +0000 | [diff] [blame] | 313 | endif( MSVC ) |
| 314 | |
| Oscar Fuentes | 980e842 | 2008-10-29 02:33:15 +0000 | [diff] [blame] | 315 | include_directories( ${LLVM_BINARY_DIR}/include ${LLVM_MAIN_INCLUDE_DIR}) |
| Oscar Fuentes | 3d01fc7 | 2008-09-22 01:08:49 +0000 | [diff] [blame] | 316 | |
| Edward O'Callaghan | c6cf5fe | 2009-10-12 04:00:11 +0000 | [diff] [blame] | 317 | if( ${CMAKE_SYSTEM_NAME} MATCHES SunOS ) |
| Michael J. Spencer | 1f6efa3 | 2010-11-29 18:16:10 +0000 | [diff] [blame] | 318 | SET(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-include llvm/Support/Solaris.h") |
| Edward O'Callaghan | c6cf5fe | 2009-10-12 04:00:11 +0000 | [diff] [blame] | 319 | endif( ${CMAKE_SYSTEM_NAME} MATCHES SunOS ) |
| 320 | |
| Oscar Fuentes | 3d01fc7 | 2008-09-22 01:08:49 +0000 | [diff] [blame] | 321 | include(AddLLVM) |
| Oscar Fuentes | e1ad087 | 2008-09-26 04:40:32 +0000 | [diff] [blame] | 322 | include(TableGen) |
| Oscar Fuentes | 3d01fc7 | 2008-09-22 01:08:49 +0000 | [diff] [blame] | 323 | |
| Michael J. Spencer | 1c4e934 | 2010-09-11 02:13:39 +0000 | [diff] [blame] | 324 | if( MINGW ) |
| 325 | get_system_libs(LLVM_SYSTEM_LIBS_LIST) |
| 326 | foreach(l ${LLVM_SYSTEM_LIBS_LIST}) |
| 327 | set(LLVM_SYSTEM_LIBS "${LLVM_SYSTEM_LIBS} -l${l}") |
| 328 | endforeach() |
| 329 | set(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES}${LLVM_SYSTEM_LIBS}") |
| 330 | set(CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES}${LLVM_SYSTEM_LIBS}") |
| 331 | endif() |
| 332 | |
| Oscar Fuentes | 53bf3ee | 2011-01-07 20:31:03 +0000 | [diff] [blame] | 333 | if( MINGW ) |
| 334 | # People report that -O3 is unreliable on MinGW. The traditional |
| 335 | # build also uses -O2 for that reason: |
| 336 | llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O2") |
| 337 | endif() |
| 338 | |
| Oscar Fuentes | 3d01fc7 | 2008-09-22 01:08:49 +0000 | [diff] [blame] | 339 | add_subdirectory(lib/Support) |
| Oscar Fuentes | 1d8e4cf | 2008-09-22 18:21:51 +0000 | [diff] [blame] | 340 | |
| Michael J. Spencer | 1f6efa3 | 2010-11-29 18:16:10 +0000 | [diff] [blame] | 341 | # Everything else depends on Support: |
| Oscar Fuentes | 1d8e4cf | 2008-09-22 18:21:51 +0000 | [diff] [blame] | 342 | set(LLVM_COMMON_DEPENDS ${LLVM_COMMON_DEPENDS} ${LLVM_LIBS} ) |
| 343 | |
| Oscar Fuentes | 3ab40ca | 2008-11-09 18:53:19 +0000 | [diff] [blame] | 344 | set(LLVM_TABLEGEN "tblgen" CACHE |
| Oscar Fuentes | 41bdedf | 2008-11-10 02:35:55 +0000 | [diff] [blame] | 345 | STRING "Native TableGen executable. Saves building one when cross-compiling.") |
| Oscar Fuentes | 99b9489 | 2009-06-11 04:16:10 +0000 | [diff] [blame] | 346 | # Effective tblgen executable to be used: |
| 347 | set(LLVM_TABLEGEN_EXE ${LLVM_TABLEGEN}) |
| Oscar Fuentes | 3ab40ca | 2008-11-09 18:53:19 +0000 | [diff] [blame] | 348 | |
| Oscar Fuentes | 02516ba | 2008-11-10 01:32:14 +0000 | [diff] [blame] | 349 | add_subdirectory(utils/TableGen) |
| 350 | |
| Oscar Fuentes | 3ab40ca | 2008-11-09 18:53:19 +0000 | [diff] [blame] | 351 | if( CMAKE_CROSSCOMPILING ) |
| Oscar Fuentes | 02516ba | 2008-11-10 01:32:14 +0000 | [diff] [blame] | 352 | # This adds a dependency on target `tblgen', so must go after utils/TableGen |
| Oscar Fuentes | 3ab40ca | 2008-11-09 18:53:19 +0000 | [diff] [blame] | 353 | include( CrossCompileLLVM ) |
| 354 | endif( CMAKE_CROSSCOMPILING ) |
| 355 | |
| Oscar Fuentes | 422fcf3 | 2008-11-15 00:24:38 +0000 | [diff] [blame] | 356 | add_subdirectory(include/llvm) |
| Oscar Fuentes | 1d8e4cf | 2008-09-22 18:21:51 +0000 | [diff] [blame] | 357 | |
| Oscar Fuentes | 3d01fc7 | 2008-09-22 01:08:49 +0000 | [diff] [blame] | 358 | add_subdirectory(lib/VMCore) |
| 359 | add_subdirectory(lib/CodeGen) |
| 360 | add_subdirectory(lib/CodeGen/SelectionDAG) |
| 361 | add_subdirectory(lib/CodeGen/AsmPrinter) |
| 362 | add_subdirectory(lib/Bitcode/Reader) |
| 363 | add_subdirectory(lib/Bitcode/Writer) |
| 364 | add_subdirectory(lib/Transforms/Utils) |
| 365 | add_subdirectory(lib/Transforms/Instrumentation) |
| Douglas Gregor | f1c3a86 | 2010-01-04 21:58:55 +0000 | [diff] [blame] | 366 | add_subdirectory(lib/Transforms/InstCombine) |
| Oscar Fuentes | 3d01fc7 | 2008-09-22 01:08:49 +0000 | [diff] [blame] | 367 | add_subdirectory(lib/Transforms/Scalar) |
| 368 | add_subdirectory(lib/Transforms/IPO) |
| 369 | add_subdirectory(lib/Transforms/Hello) |
| 370 | add_subdirectory(lib/Linker) |
| 371 | add_subdirectory(lib/Analysis) |
| 372 | add_subdirectory(lib/Analysis/IPA) |
| Daniel Dunbar | ecc63f8 | 2009-06-23 22:01:43 +0000 | [diff] [blame] | 373 | add_subdirectory(lib/MC) |
| Daniel Dunbar | 4bd8dc3 | 2010-01-22 02:04:33 +0000 | [diff] [blame] | 374 | add_subdirectory(lib/MC/MCParser) |
| Chris Lattner | 847da55 | 2010-07-20 18:25:19 +0000 | [diff] [blame] | 375 | add_subdirectory(lib/MC/MCDisassembler) |
| Michael J. Spencer | 68b3f0c | 2010-11-15 03:21:41 +0000 | [diff] [blame] | 376 | add_subdirectory(lib/Object) |
| Oscar Fuentes | e1ad087 | 2008-09-26 04:40:32 +0000 | [diff] [blame] | 377 | |
| Douglas Gregor | 4d20c24 | 2009-07-20 18:30:25 +0000 | [diff] [blame] | 378 | add_subdirectory(utils/FileCheck) |
| Michael J. Spencer | 014e189 | 2010-12-09 17:54:44 +0000 | [diff] [blame] | 379 | add_subdirectory(utils/FileUpdate) |
| Daniel Dunbar | 48f7ce8 | 2009-09-24 06:23:57 +0000 | [diff] [blame] | 380 | add_subdirectory(utils/count) |
| 381 | add_subdirectory(utils/not) |
| Michael J. Spencer | becf392 | 2010-09-13 17:52:38 +0000 | [diff] [blame] | 382 | add_subdirectory(utils/llvm-lit) |
| Douglas Gregor | 4d20c24 | 2009-07-20 18:30:25 +0000 | [diff] [blame] | 383 | |
| Oscar Fuentes | 75caad4 | 2009-08-14 04:55:21 +0000 | [diff] [blame] | 384 | set(LLVM_ENUM_ASM_PRINTERS "") |
| 385 | set(LLVM_ENUM_ASM_PARSERS "") |
| Daniel Dunbar | fa3f0b9 | 2009-11-25 04:30:13 +0000 | [diff] [blame] | 386 | set(LLVM_ENUM_DISASSEMBLERS "") |
| Oscar Fuentes | 75caad4 | 2009-08-14 04:55:21 +0000 | [diff] [blame] | 387 | foreach(t ${LLVM_TARGETS_TO_BUILD}) |
| Oscar Fuentes | e1ad087 | 2008-09-26 04:40:32 +0000 | [diff] [blame] | 388 | message(STATUS "Targeting ${t}") |
| 389 | add_subdirectory(lib/Target/${t}) |
| Daniel Dunbar | b5a8c08 | 2009-07-15 07:04:27 +0000 | [diff] [blame] | 390 | add_subdirectory(lib/Target/${t}/TargetInfo) |
| Oscar Fuentes | db2c509 | 2010-11-14 21:17:13 +0000 | [diff] [blame] | 391 | set( td ${LLVM_MAIN_SRC_DIR}/lib/Target/${t} ) |
| 392 | file(GLOB asmp_file "${td}/*AsmPrinter.cpp") |
| 393 | if( asmp_file ) |
| Michael J. Spencer | 1f6efa3 | 2010-11-29 18:16:10 +0000 | [diff] [blame] | 394 | set(LLVM_ENUM_ASM_PRINTERS |
| Chris Lattner | aeafb89 | 2010-11-14 19:12:57 +0000 | [diff] [blame] | 395 | "${LLVM_ENUM_ASM_PRINTERS}LLVM_ASM_PRINTER(${t})\n") |
| Oscar Fuentes | 14b0c05 | 2010-11-14 20:15:05 +0000 | [diff] [blame] | 396 | endif() |
| Oscar Fuentes | db2c509 | 2010-11-14 21:17:13 +0000 | [diff] [blame] | 397 | if( EXISTS ${td}/InstPrinter/CMakeLists.txt ) |
| Oscar Fuentes | bab2b01 | 2010-10-02 02:38:42 +0000 | [diff] [blame] | 398 | add_subdirectory(lib/Target/${t}/InstPrinter) |
| Oscar Fuentes | db2c509 | 2010-11-14 21:17:13 +0000 | [diff] [blame] | 399 | endif() |
| 400 | if( EXISTS ${td}/AsmParser/CMakeLists.txt ) |
| Oscar Fuentes | 75caad4 | 2009-08-14 04:55:21 +0000 | [diff] [blame] | 401 | add_subdirectory(lib/Target/${t}/AsmParser) |
| Michael J. Spencer | 1f6efa3 | 2010-11-29 18:16:10 +0000 | [diff] [blame] | 402 | set(LLVM_ENUM_ASM_PARSERS |
| Oscar Fuentes | 75caad4 | 2009-08-14 04:55:21 +0000 | [diff] [blame] | 403 | "${LLVM_ENUM_ASM_PARSERS}LLVM_ASM_PARSER(${t})\n") |
| Oscar Fuentes | db2c509 | 2010-11-14 21:17:13 +0000 | [diff] [blame] | 404 | endif() |
| 405 | if( EXISTS ${td}/Disassembler/CMakeLists.txt ) |
| Daniel Dunbar | fa3f0b9 | 2009-11-25 04:30:13 +0000 | [diff] [blame] | 406 | add_subdirectory(lib/Target/${t}/Disassembler) |
| 407 | set(LLVM_ENUM_DISASSEMBLERS |
| 408 | "${LLVM_ENUM_DISASSEMBLERS}LLVM_DISASSEMBLER(${t})\n") |
| Oscar Fuentes | db2c509 | 2010-11-14 21:17:13 +0000 | [diff] [blame] | 409 | endif() |
| Oscar Fuentes | b78829e | 2009-08-16 05:16:43 +0000 | [diff] [blame] | 410 | set(CURRENT_LLVM_TARGET) |
| Oscar Fuentes | e1ad087 | 2008-09-26 04:40:32 +0000 | [diff] [blame] | 411 | endforeach(t) |
| 412 | |
| Douglas Gregor | 1555a23 | 2009-06-16 20:12:29 +0000 | [diff] [blame] | 413 | # Produce llvm/Config/AsmPrinters.def |
| 414 | configure_file( |
| 415 | ${LLVM_MAIN_INCLUDE_DIR}/llvm/Config/AsmPrinters.def.in |
| 416 | ${LLVM_BINARY_DIR}/include/llvm/Config/AsmPrinters.def |
| 417 | ) |
| 418 | |
| Daniel Dunbar | 092a9dd | 2009-07-17 20:42:00 +0000 | [diff] [blame] | 419 | # Produce llvm/Config/AsmParsers.def |
| 420 | configure_file( |
| 421 | ${LLVM_MAIN_INCLUDE_DIR}/llvm/Config/AsmParsers.def.in |
| 422 | ${LLVM_BINARY_DIR}/include/llvm/Config/AsmParsers.def |
| 423 | ) |
| 424 | |
| Daniel Dunbar | fa3f0b9 | 2009-11-25 04:30:13 +0000 | [diff] [blame] | 425 | # Produce llvm/Config/Disassemblers.def |
| 426 | configure_file( |
| 427 | ${LLVM_MAIN_INCLUDE_DIR}/llvm/Config/Disassemblers.def.in |
| 428 | ${LLVM_BINARY_DIR}/include/llvm/Config/Disassemblers.def |
| 429 | ) |
| 430 | |
| Oscar Fuentes | 3d01fc7 | 2008-09-22 01:08:49 +0000 | [diff] [blame] | 431 | add_subdirectory(lib/ExecutionEngine) |
| 432 | add_subdirectory(lib/ExecutionEngine/Interpreter) |
| 433 | add_subdirectory(lib/ExecutionEngine/JIT) |
| Wesley Peck | b977f04 | 2010-11-17 23:35:07 +0000 | [diff] [blame] | 434 | add_subdirectory(lib/ExecutionEngine/MCJIT) |
| Oscar Fuentes | 3d01fc7 | 2008-09-22 01:08:49 +0000 | [diff] [blame] | 435 | add_subdirectory(lib/Target) |
| 436 | add_subdirectory(lib/AsmParser) |
| Oscar Fuentes | 3d01fc7 | 2008-09-22 01:08:49 +0000 | [diff] [blame] | 437 | add_subdirectory(lib/Archive) |
| 438 | |
| Oscar Fuentes | 5c6bf65 | 2009-03-06 01:16:52 +0000 | [diff] [blame] | 439 | add_subdirectory(projects) |
| Oscar Fuentes | 3d01fc7 | 2008-09-22 01:08:49 +0000 | [diff] [blame] | 440 | |
| Oscar Fuentes | a6c1dbd | 2010-09-25 20:43:06 +0000 | [diff] [blame] | 441 | option(LLVM_BUILD_TOOLS |
| 442 | "Build the LLVM tools. If OFF, just generate build targets." ON) |
| 443 | option(LLVM_INCLUDE_TOOLS "Generate build targets for the LLVM tools." ON) |
| 444 | if( LLVM_INCLUDE_TOOLS ) |
| 445 | add_subdirectory(tools) |
| 446 | endif() |
| Oscar Fuentes | c81f56d | 2009-08-16 20:56:30 +0000 | [diff] [blame] | 447 | |
| Oscar Fuentes | a6c1dbd | 2010-09-25 20:43:06 +0000 | [diff] [blame] | 448 | option(LLVM_BUILD_EXAMPLES |
| 449 | "Build the LLVM example programs. If OFF, just generate build targets." OFF) |
| 450 | option(LLVM_INCLUDE_EXAMPLES "Generate build targets for the LLVM examples" ON) |
| 451 | if( LLVM_INCLUDE_EXAMPLES ) |
| 452 | add_subdirectory(examples) |
| 453 | endif() |
| Oscar Fuentes | 1dc9716 | 2008-10-22 02:56:07 +0000 | [diff] [blame] | 454 | |
| Oscar Fuentes | a6c1dbd | 2010-09-25 20:43:06 +0000 | [diff] [blame] | 455 | option(LLVM_BUILD_TESTS |
| 456 | "Build LLVM unit tests. If OFF, just generate build targes." OFF) |
| 457 | option(LLVM_INCLUDE_TESTS "Generate build targets for the LLVM unit tests." ON) |
| 458 | if( LLVM_INCLUDE_TESTS ) |
| 459 | add_subdirectory(test) |
| 460 | add_subdirectory(utils/unittest) |
| 461 | add_subdirectory(unittests) |
| NAKAMURA Takumi | 15b337c | 2010-10-26 05:08:27 +0000 | [diff] [blame] | 462 | if (MSVC) |
| Michael J. Spencer | bbb9ea7 | 2010-10-11 19:55:38 +0000 | [diff] [blame] | 463 | # This utility is used to prevent chrashing tests from calling Dr. Watson on |
| 464 | # Windows. |
| 465 | add_subdirectory(utils/KillTheDoctor) |
| 466 | endif() |
| Oscar Fuentes | a6c1dbd | 2010-09-25 20:43:06 +0000 | [diff] [blame] | 467 | endif() |
| Michael J. Spencer | ee6944f | 2010-09-24 09:01:13 +0000 | [diff] [blame] | 468 | |
| Oscar Fuentes | 6252e98 | 2010-08-09 03:26:43 +0000 | [diff] [blame] | 469 | add_subdirectory(cmake/modules) |
| 470 | |
| Oscar Fuentes | 1d7c43b | 2009-10-27 19:57:29 +0000 | [diff] [blame] | 471 | install(DIRECTORY include/ |
| 472 | DESTINATION include |
| 473 | FILES_MATCHING |
| Oscar Fuentes | bc2eb13 | 2009-10-30 11:42:08 +0000 | [diff] [blame] | 474 | PATTERN "*.def" |
| Oscar Fuentes | 1d7c43b | 2009-10-27 19:57:29 +0000 | [diff] [blame] | 475 | PATTERN "*.h" |
| 476 | PATTERN "*.td" |
| Oscar Fuentes | a2281e7 | 2009-10-27 20:04:22 +0000 | [diff] [blame] | 477 | PATTERN "*.inc" |
| Oscar Fuentes | 1dc9716 | 2008-10-22 02:56:07 +0000 | [diff] [blame] | 478 | PATTERN ".svn" EXCLUDE |
| Oscar Fuentes | 1dc9716 | 2008-10-22 02:56:07 +0000 | [diff] [blame] | 479 | ) |
| 480 | |
| Oscar Fuentes | 1d7c43b | 2009-10-27 19:57:29 +0000 | [diff] [blame] | 481 | install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/ |
| 482 | DESTINATION include |
| 483 | FILES_MATCHING |
| 484 | PATTERN "*.def" |
| 485 | PATTERN "*.h" |
| 486 | PATTERN "*.gen" |
| Oscar Fuentes | a2281e7 | 2009-10-27 20:04:22 +0000 | [diff] [blame] | 487 | PATTERN "*.inc" |
| Oscar Fuentes | 1d7c43b | 2009-10-27 19:57:29 +0000 | [diff] [blame] | 488 | # Exclude include/llvm/CMakeFiles/intrinsics_gen.dir, matched by "*.def" |
| 489 | PATTERN "CMakeFiles" EXCLUDE |
| 490 | PATTERN ".svn" EXCLUDE |
| Oscar Fuentes | 1dc9716 | 2008-10-22 02:56:07 +0000 | [diff] [blame] | 491 | ) |
| 492 | |
| 493 | # TODO: make and install documentation. |
| Oscar Fuentes | 4d156d3 | 2010-10-14 21:11:51 +0000 | [diff] [blame] | 494 | |
| 495 | set(CPACK_PACKAGE_VENDOR "LLVM") |
| 496 | set(CPACK_PACKAGE_VERSION_MAJOR 2) |
| 497 | set(CPACK_PACKAGE_VERSION_MINOR 9) |
| 498 | add_version_info_from_vcs(CPACK_PACKAGE_VERSION_PATCH) |
| 499 | include(CPack) |
| NAKAMURA Takumi | 4c8710d | 2010-11-19 03:19:18 +0000 | [diff] [blame] | 500 | |
| 501 | # Workaround for MSVS10 to avoid the Dialog Hell |
| 502 | # FIXME: This could be removed with future version of CMake. |
| 503 | if(MSVC_VERSION EQUAL 1600) |
| 504 | set(LLVM_SLN_FILENAME "${CMAKE_CURRENT_BINARY_DIR}/LLVM.sln") |
| 505 | if( EXISTS "${LLVM_SLN_FILENAME}" ) |
| 506 | file(APPEND "${LLVM_SLN_FILENAME}" "\n# This should be regenerated!\n") |
| 507 | endif() |
| 508 | endif() |