Lines Matching +full:llvm +full:- +full:config
1 # See docs/CMake.html for instructions about how to build LLVM with CMake.
48 project(LLVM project
59 message(STATUS "Found libtool - ${CMAKE_LIBTOOL}")
63 "${CMAKE_LIBTOOL} -static -o <TARGET> <LINK_FLAGS> <OBJECTS> ")
82 add_definitions(-DLLVM_BUILD_GLOBAL_ISEL)
119 "Append the version control system revision id to LLVM version" OFF)
125 set(PACKAGE_NAME LLVM)
127 set(PACKAGE_BUGREPORT "http://llvm.org/bugs/")
133 set(CPACK_PACKAGE_INSTALL_DIRECTORY "LLVM")
134 set(CPACK_PACKAGE_VENDOR "LLVM")
142 set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "LLVM")
159 # generate an in-tree build (unless on MSVC_IDE, where it is ok), and to make
164 message(FATAL_ERROR "In-source builds are not allowed.
165 CMake would overwrite the makefiles distributed with LLVM.
174 "${CMAKE_CURRENT_SOURCE_DIR}/include/llvm/*.gen")
179 message(FATAL_ERROR "Apparently there is a previous in-source build,
205 # DLL platform -- put DLLs into bin.
211 # Each of them corresponds to llvm-config's.
212 set(LLVM_TOOLS_BINARY_DIR ${LLVM_RUNTIME_OUTPUT_INTDIR}) # --bindir
213 set(LLVM_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}) # --libdir
214 set(LLVM_MAIN_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR} ) # --src-root
215 set(LLVM_MAIN_INCLUDE_DIR ${LLVM_MAIN_SRC_DIR}/include ) # --includedir
216 set(LLVM_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR} ) # --prefix
241 CACHE STRING "Semicolon-separated list of targets to build, or \"all\".")
244 CACHE STRING "Semicolon-separated list of experimental targets to build.")
264 CACHE STRING "Set target to use for LLVM JIT or use \"host\" for automatic detection.")
283 option(LLVM_ENABLE_PIC "Build Position-Independent Code" ON)
287 option(LLVM_ENABLE_MODULE_DEBUGGING "Compile with -gmodules." ON)
288 …option(LLVM_ENABLE_LOCAL_SUBMODULE_VISIBILITY "Compile with -fmodules-local-submodule-visibility."…
290 option(LLVM_ENABLE_MODULE_DEBUGGING "Compile with -gmodules." OFF)
291 …option(LLVM_ENABLE_LOCAL_SUBMODULE_VISIBILITY "Compile with -fmodules-local-submodule-visibility."…
308 "Enable abi-breaking checks. Can be WITH_ASSERTS, FORCE_ON or FORCE_OFF.")
342 "Use -gsplit-dwarf when compiling llvm." OFF)
345 option(LLVM_POLLY_BUILD "Build LLVM with Polly" ON)
365 # Define an option controlling whether we should build for 32-bit on 64-bit
374 set(LIT_ARGS_DEFAULT "-sv")
376 set(LIT_ARGS_DEFAULT "${LIT_ARGS_DEFAULT} --no-progress-bar")
389 option(LLVM_INCLUDE_TOOLS "Generate build targets for the LLVM tools." ON)
391 "Build the LLVM tools. If OFF, just generate build targets." ON)
393 option(LLVM_INCLUDE_UTILS "Generate build targets for the LLVM utils." ON)
395 "Build LLVM utility binaries. If OFF, just generate build targets." ON)
398 "Build the LLVM runtime libraries." ON)
400 "Build the LLVM example programs. If OFF, just generate build targets." OFF)
401 option(LLVM_INCLUDE_EXAMPLES "Generate build targets for the LLVM examples" ON)
404 "Build LLVM unit tests. If OFF, just generate build targets." OFF)
405 option(LLVM_INCLUDE_TESTS "Generate build targets for the LLVM unit tests." ON)
408 option (LLVM_BUILD_DOCS "Build the llvm documentation." OFF)
409 option (LLVM_INCLUDE_DOCS "Generate build targets for llvm documentation." ON)
410 option (LLVM_ENABLE_DOXYGEN "Use doxygen to generate llvm API documentation." OFF)
411 option (LLVM_ENABLE_SPHINX "Use Sphinx to generate llvm documentation." OFF)
414 "Build compiler-rt as an external project." OFF)
416 # You can configure which libraries from LLVM you want to include in the
417 # shared library by setting LLVM_DYLIB_COMPONENTS to a semi-colon delimited
418 # list of LLVM components. All component names handled by llvm-config are valid.
421 "Semicolon-separated list of components to include in libLLVM, or \"all\".")
424 option(LLVM_BUILD_LLVM_C_DYLIB "Build libllvm-c re-export library (Darwin Only)" OFF)
444 # A pool size of 1-2 is probably sufficient on a SSD. 3-4 should be fine
460 include(config-ix)
469 "Default target for which LLVM will generate code." )
493 # We use llvm-build to generate all the data required by the CMake based
496 # - We generate a file (a CMake fragment) in the object root which contains
499 # - We generate the library table used by llvm-config.
501 # - We generate the dependencies for the CMake fragment, so that we will
504 set(LLVMBUILDTOOL "${LLVM_MAIN_SRC_DIR}/utils/llvm-build/llvm-build")
506 "${LLVM_BINARY_DIR}/tools/llvm-config/LibraryDependencies.inc")
521 --native-target "${LLVM_NATIVE_ARCH}"
522 --enable-targets "${LLVM_TARGETS_TO_BUILD}"
523 --enable-optional-components "${LLVMOPTIONALCOMPONENTS}"
524 --write-library-table ${LLVMCONFIGLIBRARYDEPENDENCIESINC}
525 --write-cmake-fragment ${LLVMBUILDCMAKEFRAG}
535 message(STATUS "llvm-build output: ${LLVMBUILDOUTPUT}")
539 "Unexpected failure executing llvm-build: ${LLVMBUILDERRORS}")
550 # Configure all of the various header file fragments LLVM uses which depend on
586 ${LLVM_MAIN_INCLUDE_DIR}/llvm/Config/AsmPrinters.def.in
587 ${LLVM_INCLUDE_DIR}/llvm/Config/AsmPrinters.def
590 ${LLVM_MAIN_INCLUDE_DIR}/llvm/Config/AsmParsers.def.in
591 ${LLVM_INCLUDE_DIR}/llvm/Config/AsmParsers.def
594 ${LLVM_MAIN_INCLUDE_DIR}/llvm/Config/Disassemblers.def.in
595 ${LLVM_INCLUDE_DIR}/llvm/Config/Disassemblers.def
598 ${LLVM_MAIN_INCLUDE_DIR}/llvm/Config/Targets.def.in
599 ${LLVM_INCLUDE_DIR}/llvm/Config/Targets.def
602 # Configure the three LLVM configuration header files.
604 ${LLVM_MAIN_INCLUDE_DIR}/llvm/Config/config.h.cmake
605 ${LLVM_INCLUDE_DIR}/llvm/Config/config.h)
607 ${LLVM_MAIN_INCLUDE_DIR}/llvm/Config/llvm-config.h.cmake
608 ${LLVM_INCLUDE_DIR}/llvm/Config/llvm-config.h)
610 ${LLVM_MAIN_INCLUDE_DIR}/llvm/Support/DataTypes.h.cmake
611 ${LLVM_INCLUDE_DIR}/llvm/Support/DataTypes.h)
626 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-z,origin")
627 set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,origin")
634 "${CMAKE_EXE_LINKER_FLAGS} -Wl,-lto_library -Wl,${DARWIN_LTO_LIBRARY}")
636 "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-lto_library -Wl,${DARWIN_LTO_LIBRARY}")
638 "${CMAKE_MODULE_LINKER_FLAGS} -Wl,-lto_library -Wl,${DARWIN_LTO_LIBRARY}")
648 "${CMAKE_EXE_LINKER_FLAGS} -Wl,-allow-shlib-undefined")
660 # Dummy use to avoid CMake Wraning: Manually-specified variables were not used
665 # On FreeBSD, /usr/local/* is not used by default. In order to build LLVM
672 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -include llvm/Support/Solaris.h")
675 # Make sure we don't get -rdynamic in every binary. For those that need it,
684 add_definitions("-fprofile-instr-use=${LLVM_PROFDATA_FILE}")
694 # People report that -O3 is unreliable on MinGW. The traditional
695 # build also uses -O2 for that reason:
696 llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O2")
706 # header-wise on it as they ship all headers from the umbrella folders. Building
714 add_subdirectory(include/llvm)
723 add_subdirectory(utils/llvm-lit)
724 add_subdirectory(utils/yaml-bench)
760 if(EXISTS ${LLVM_MAIN_SRC_DIR}/projects/test-suite AND TARGET clang)
762 llvm_ExternalProject_Add(test-suite ${LLVM_MAIN_SRC_DIR}/projects/test-suite
782 add_lit_target(check-all
789 add_custom_target(test-depends DEPENDS ${LLVM_LIT_DEPENDS})
790 set_target_properties(test-depends PROPERTIES FOLDER "Tests")
800 install(DIRECTORY include/llvm include/llvm-c
802 COMPONENT llvm-headers
812 install(DIRECTORY ${LLVM_INCLUDE_DIR}/llvm
814 COMPONENT llvm-headers
820 # Exclude include/llvm/CMakeFiles/intrinsics_gen.dir, matched by "*.def"
822 PATTERN "config.h" EXCLUDE
830 -DCMAKE_INSTALL_COMPONENT=llvm-headers
831 -P "${CMAKE_BINARY_DIR}/cmake_install.cmake")
835 # This must be at the end of the LLVM root CMakeLists file because it must run
839 …message(FATAL_ERROR "LLVM_DISTRIBUTION_COMPONENTS cannot be specified with multi-configuration gen…
843 add_custom_target(install-distribution)
851 if(TARGET install-${target})
852 add_dependencies(install-distribution install-${target})