set(PACKAGE_VERSION svn)
set(PACKAGE_BUGREPORT "llvmbugs@cs.uiuc.edu")
+if( CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR AND NOT MSVC_IDE )
+ message(FATAL_ERROR "In-source builds are not allowed.
+CMake would overwrite the makefiles distributed with LLVM.
+Please create a directory and run cmake from there, passing the path
+to this source directory as the last argument.
+This process created the file `CMakeCache.txt' and the directory `CMakeFiles'.
+Please delete them.")
+endif()
+
include(FindPerl)
set(LLVM_MAIN_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR})
XCore
)
+# List of targets whose asmprinters need to be forced to link
+# into executables on some platforms (i.e. Windows):
+set(LLVM_ASMPRINTERS_FORCE_LINK X86 PowerPC)
+
if( MSVC )
set(LLVM_TARGETS_TO_BUILD X86
CACHE STRING "Semicolon-separated list of targets to build, or \"all\".")
if( EXISTS ${LLVM_TOOLS_BINARY_DIR}/llvm-config )
set(HAVE_LLVM_CONFIG 1)
endif( EXISTS ${LLVM_TOOLS_BINARY_DIR}/llvm-config )
-# find_file(HAVE_LLVM_CONFIG llvm-config ${LLVM_TOOLS_BINARY_DIR})
-# message(STATUS ${HAVE_LLVM_CONFIG})
include(config-ix)
endif( MSVC )
include_directories( ${LLVM_BINARY_DIR}/include ${LLVM_MAIN_INCLUDE_DIR})
-#link_directories( d:/dev/lib )
-
-#add_subdirectory(lib)
include(AddLLVM)
include(AddPartiallyLinkedObject)
set(LLVM_COMMON_DEPENDS ${LLVM_COMMON_DEPENDS} ${LLVM_LIBS} )
set(LLVM_TABLEGEN "tblgen" CACHE
- STRING "Native TableGen executable.")
+ STRING "Native TableGen executable. Saves building one when cross-compiling.")
add_subdirectory(utils/TableGen)
include( CrossCompileLLVM )
endif( CMAKE_CROSSCOMPILING )
-add_custom_command(OUTPUT ${llvm_builded_incs_dir}/Intrinsics.gen
- COMMAND ${LLVM_TABLEGEN} -gen-intrinsic -I ${LLVM_MAIN_INCLUDE_DIR} ${LLVM_MAIN_INCLUDE_DIR}/llvm/Intrinsics.td -o ${llvm_builded_incs_dir}/Intrinsics.gen
- DEPENDS tblgen
- COMMENT "Building intrinsics.gen...")
-
-add_custom_target(intrinsics_gen ALL
- DEPENDS ${llvm_builded_incs_dir}/Intrinsics.gen)
-
-set(LLVM_COMMON_DEPENDS ${LLVM_COMMON_DEPENDS} intrinsics_gen )
+add_subdirectory(include/llvm)
add_subdirectory(lib/VMCore)
add_subdirectory(lib/CodeGen)
foreach(t ${LLVM_TARGETS_TO_BUILD})
message(STATUS "Targeting ${t}")
add_subdirectory(lib/Target/${t})
- if( EXISTS ${CMAKE_SOURCE_DIR}/lib/Target/${t}/AsmPrinter/CMakeLists.txt )
+ if( EXISTS ${LLVM_MAIN_SRC_DIR}/lib/Target/${t}/AsmPrinter/CMakeLists.txt )
add_subdirectory(lib/Target/${t}/AsmPrinter)
- endif( EXISTS ${CMAKE_SOURCE_DIR}/lib/Target/${t}/AsmPrinter/CMakeLists.txt )
+ endif( EXISTS ${LLVM_MAIN_SRC_DIR}/lib/Target/${t}/AsmPrinter/CMakeLists.txt )
endforeach(t)
add_subdirectory(lib/ExecutionEngine)