summaryrefslogtreecommitdiffstats
path: root/llvm/cmake/modules/AddLLVM.cmake
Commit message (Collapse)AuthorAgeFilesLines
* [CMake] Unbreak add_llvm_external_project when external projects are specified.NAKAMURA Takumi2015-07-141-0/+3
| | | | | | | | LLVM_EXTERNAL_*_SOURCE_DIR is reset as PATH with set(CACHE PATH). Then the CACHE PATH variable, LLVM_EXTERNAL_*_SOURCE_DIR, is normalized as ${CMAKE_SOURCE_DIR}/${path_var} if ${path_var} is relative. llvm-svn: 242120
* [CMake] Forgot to quote the first part of STREQUAL.Chris Bieneman2015-07-141-1/+1
| | | | llvm-svn: 242103
* [CMake] We shouldn't be storing values in the cache unless they actually ↵Chris Bieneman2015-07-141-4/+9
| | | | | | | | | | | | need CMake cache behavior. add_llvm_external_project puts LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR into the cache even if it is just the in-tree default path. This causes all sorts of oddness, and makes it so that I can't change the behavior of this variable. This patch never puts LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR into the cache. It will only end up in the cache if it is specified on the command line, which is the correct behavior. There is also a temporary change to remove non-default values from the cache if they are already present. This should have the impact of cleaning out unncecissary values from the caches on the buildbots and people's local build directories. This part of the change is marked with a TODO and can be removed in a few days. llvm-svn: 242102
* Revert "[CMake] Cleanup tools/CMakeLists.txt to take advantage of the ↵Chris Bieneman2015-07-131-64/+21
| | | | | | | | auto-registration that was already partially working." Reverting r242059 because it broke some bots. I'm attempting to reproduce the failures now. llvm-svn: 242060
* [CMake] Cleanup tools/CMakeLists.txt to take advantage of the ↵Chris Bieneman2015-07-131-21/+64
| | | | | | | | | | | | | | | | | | | auto-registration that was already partially working. Summary: This change re-lands r241621, with an additional fix that was required to allow tool sources to live outside the llvm checkout. It also no longer renames LLVM_EXTERNAL_*_SOURCE_DIR. This change was reverted in r241663, because it renamed several variables of the format LLVM_EXTERNAL_*_* to LLVM_TOOL_*_*. Original Summary: The tools CMakeLists file already had implicit tool registration, but there were a few things off about it that needed to be altered to make it work. This change addresses all that. The changes in this patch are: * factored out canonicalizing tool names from paths to CMake variables * removed the LLVM_IMPLICIT_PROJECT_IGNORE mechanism in favor of LLVM_EXTERNAL_${nameUPPER}_BUILD which I renamed to LLVM_TOOL_${nameUPPER}_BUILD because it applies to internal and external tools * removed ignore_llvm_tool_subdirectory() in favor of just setting LLVM_TOOL_${nameUPPER}_BUILD to Off * Added create_llvm_tool_options() to resolve a bug in add_llvm_external_project() - the old LLVM_EXTERNAL_${nameUPPER}_BUILD would not work on a clean CMake directory because the option could be created after it was set in code. * Removed all but the minimum required calls to add_llvm_external_project from tools/CMakeLists.txt Differential Revision: http://reviews.llvm.org/D10665 llvm-svn: 242059
* Revert r241621, "[CMake] Cleanup tools/CMakeLists.txt to take advantage of ↵NAKAMURA Takumi2015-07-081-31/+19
| | | | | | | | the auto-registration that was already partially working." It broke the build that relies on LLVM_EXTERNAL_CLANG_*. llvm-svn: 241663
* [CMake] Cleanup tools/CMakeLists.txt to take advantage of the ↵Chris Bieneman2015-07-071-19/+31
| | | | | | | | | | | | | | | | | | | | | auto-registration that was already partially working. Summary: The tools CMakeLists file already had implicit tool registration, but there were a few things off about it that needed to be altered to make it work. This change addresses all that. The changes in this patch are: * factored out canonicalizing tool names from paths to CMake variables * removed the LLVM_IMPLICIT_PROJECT_IGNORE mechanism in favor of LLVM_EXTERNAL_${nameUPPER}_BUILD which I renamed to LLVM_TOOL_${nameUPPER}_BUILD because it applies to internal and external tools * removed ignore_llvm_tool_subdirectory() in favor of just setting LLVM_TOOL_${nameUPPER}_BUILD to Off * Added create_llvm_tool_options() to resolve a bug in add_llvm_external_project() - the old LLVM_EXTERNAL_${nameUPPER}_BUILD would not work on a clean CMake directory because the option could be created after it was set in code. * Removed all but the minimum required calls to add_llvm_external_project from tools/CMakeLists.txt Reviewers: bogner, samsonov, chapuni, beanz Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10665 llvm-svn: 241621
* [CMake] add_llvm_symbol_exports: Use Python oneliner instead of "cmd.exe /c ↵NAKAMURA Takumi2015-07-051-13/+2
| | | | | | type" to generate *.def. llvm-svn: 241402
* Fix bug #23967. The gtest and gtest_main targets were exported into theDan Liew2015-06-291-2/+8
| | | | | | | | | | | | | | | | | | | CMake files and should not be by both build systems and also the targets were also installed by the CMake build system which they should not be. The problem was that - the CMake build of LLVM installs and exports the gtest library targets. We should not being doing this, these are not part of LLVM. - the Autoconf/Makefile build of LLVM still had gtest libraries in the installed LLVMConfig.cmake. These problems would cause problems for an external project because when calling llvm_map_components_to_libnames(XXX all) ${XXX} would to contain LLVM's internal gtest libraries. llvm-svn: 240981
* Support Solaris unused sections' gc link syntax.Rafael Espindola2015-06-221-0/+3
| | | | | | | | | It is not clear if this would work or not with LLVM_NO_DEAD_STRIP binaries, so be conservative for now. Patch by Xan López. llvm-svn: 240287
* Do not pass optimization flags to Solaris' linker.Rafael Espindola2015-06-221-1/+1
| | | | | | | | It is not supported. Patch by Xan López. llvm-svn: 240276
* Use right syntax to pass version script to Solaris' ld.Rafael Espindola2015-06-221-2/+7
| | | | | | Patch by Xan Lopez! llvm-svn: 240275
* CMake: Stop using LLVM's custom parse_arguments. NFCFilipe Cabecinhas2015-06-191-8/+7
| | | | | | | | | | | | | | | | | | Summary: Use CMake's cmake_parse_arguments() instead. It's called in a slightly different way, but supports all our use cases. It's in CMake 2.8.8, which is our minimum supported version. CMake 3.0 doc (roughly the same. No direct link to 2.8.8 doc): http://www.cmake.org/cmake/help/v3.0/module/CMakeParseArguments.html?highlight=cmake_parse_arguments Reviewers: pcc, beanz, chapuni Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10531 llvm-svn: 240121
* Silence resource compiler using /nologo flag.Peter Collingbourne2015-06-181-0/+2
| | | | llvm-svn: 239983
* [CMake] Try to fix r239612, not to miss ↵NAKAMURA Takumi2015-06-141-3/+5
| | | | | | | | | | resources/windows_version_resource.rc in clang build. - Who defines ${LLVM_SOURCE_DIR} ? - Would windows_version_resource.rc be available in an *installed* llvm tree? I suggest it may be installed in ${PREFIX}/share. llvm-svn: 239703
* In MSVC builds embed a VERSIONINFO resource in our exe and DLL files.Greg Bedwell2015-06-121-0/+82
| | | | | | | | This reinstates my commits r238740/r238741 which I reverted due to a failure in the clang-cl selfhost tests on Windows. I've now fixed the issue in clang-cl that caused the failure so hopefully all should be well now. llvm-svn: 239612
* [CMake] Revert commits r238740/r238741 for embedding Windows version info.Greg Bedwell2015-06-011-82/+0
| | | | | | | The clang Windows bots are showing mysterious failures. Reverting until I can figure out what's going on. llvm-svn: 238744
* remove the use of the LOCATION CMake variable from r238740.Greg Bedwell2015-06-011-4/+0
| | | | | | | It caused the following failure: "Policy CMP0026 is not set: Disallow use of the LOCATION target property." llvm-svn: 238741
* In MSVC builds embed a VERSIONINFO resource in our exe and DLL files.Greg Bedwell2015-06-011-0/+86
| | | | | | | | | | This embeds Windows version information into our executables and DLLs. The most visible place to view this data is in the details tab of the file properties window in Windows explorer. Differential Revision: http://reviews.llvm.org/D7828 llvm-svn: 238740
* Use cat and not type Under MSYS, same as Cygwin.Yaron Keren2015-05-191-1/+1
| | | | | | | | type means something else under the MSYS shell. Patch by Tzafrir Poupko! llvm-svn: 237692
* [cmake] Quote the path to the target exports file, fixes PR23313Reid Kleckner2015-04-221-1/+1
| | | | llvm-svn: 235519
* Cleanup based on rnk's feedback.Chris Bieneman2015-04-161-12/+8
| | | | llvm-svn: 235125
* Fixing windows bots.Chris Bieneman2015-04-161-10/+12
| | | | | | Third time's the try. llvm-svn: 235123
* Better fix to the windows conditional.Chris Bieneman2015-04-161-1/+1
| | | | llvm-svn: 235121
* Fix Windows bots.Chris Bieneman2015-04-161-1/+6
| | | | | | Turns out Windows is special. All library installs are RUNTIME. llvm-svn: 235120
* Fixing a mis-use of the CMake install command.Chris Bieneman2015-04-161-6/+16
| | | | | | | | | | | | | | | | | | | | | The CMake install command is defined as: install(TARGETS targets... [EXPORT <export-name>] [[ARCHIVE|LIBRARY|RUNTIME|FRAMEWORK|BUNDLE| PRIVATE_HEADER|PUBLIC_HEADER|RESOURCE] [DESTINATION <dir>] [INCLUDES DESTINATION [<dir> ...]] [PERMISSIONS permissions...] [CONFIGURATIONS [Debug|Release|...]] [COMPONENT <component>] [OPTIONAL] [NAMELINK_ONLY|NAMELINK_SKIP] ] [...]) This means it can only take one parameter from the set of RUNTIME, LIBRARY, or ARCHIVE. If you set more than one of these it seems to gobble up the extra arguments and ignore the COMPONENT argument. This adds a check to only set LIBRARY or ARCHIVE based on whether or not the library being built is shared. llvm-svn: 235113
* Disable all link optimizations in a debug build.Rafael Espindola2015-04-061-25/+28
| | | | | | | This taking linking clang on my machine with gold from 16.980257914 to 15.933037649 seconds. llvm-svn: 234161
* Don't pass -O3 to the linker in debug builds.Rafael Espindola2015-04-061-2/+4
| | | | | | | This takes linking clang in a debug build with gold form 19.518925697 to 16.406388685 seconds. llvm-svn: 234160
* [CMake] Removing duplicates from the list of test suites to generate targets ↵Chris Bieneman2015-03-271-0/+5
| | | | | | | | for. Not doing this causes some headaches for users migrating from autoconf to CMake. llvm-svn: 233428
* CMake: enable installing utilsDerek Schuff2015-03-271-0/+12
| | | | | | | | | | | | | | | | | | | | | | | Added a new boolean CMake flag, LLVM_INSTALL_UTILS. When set, the 'install' target will include in the bin directory the utils binaries - e.g. FileCheck. This mirrors the autoconfig behavior. Test Plan: Locally verified that utils binaries are copied when flag is set, and not copied when flag is not set. Reviewers: jfb, dschuff, beanz Reviewed By: beanz Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D8587 Patch by Mircea Trofin llvm-svn: 233385
* Re-land: Generate targets for each lit suite.Chris Bieneman2015-03-231-0/+22
| | | | | | | | | | | | | | | | | | | | | Summary: This change makes CMake scan for lit suites and generate a target for each lit test suite. The targets follow the format check-<project>-<suite path>. For example: check-llvm-unit - Runs the LLVM unit tests check-llvm-codegen-arm - Runs the ARM codeine tests Note: These targets are not generated during multi-configuration generators (i.e. Xcode and Visual Studio) because target clutter impacts UI usability. * Also fixed a minor issue that Duncan pointed out to me I was passing the suite to lit twice Reviewers: chandlerc Subscribers: aemerson, llvm-commits Differential Revision: http://reviews.llvm.org/D8380 llvm-svn: 233009
* Revert "Generate targets for each lit suite."Chris Bieneman2015-03-181-23/+0
| | | | | | This change broke Polly. I'll track down the failure when I have a chance and re-apply the change. llvm-svn: 232676
* Generate targets for each lit suite.Chris Bieneman2015-03-181-0/+23
| | | | | | | | | | | | | | | | | | | Summary: This change makes CMake scan for lit suites and generate a target for each lit test suite. The targets follow the format check-<project>-<suite path>. For example: check-llvm-unit - Runs the LLVM unit tests check-llvm-codegen-arm - Runs the ARM codeine tests Note: These targets are not generated during multi-configuration generators (i.e. Xcode and Visual Studio) because target clutter impacts UI usability. Reviewers: chandlerc Subscribers: aemerson, llvm-commits Differential Revision: http://reviews.llvm.org/D8380 llvm-svn: 232671
* CMake: Disable ENABLE_EXPORTS for executables with MSVCReid Kleckner2015-03-181-0/+6
| | | | | | | | | | | | | | The MSVC linker won't produce a .lib file for an executable that doesn't export anything, and LLVM doesn't maintain dllexport annotations or .def files listing all C++ symbols. It also doesn't support exporting all symbols, like binutils ld. CMake 3.2 changed the Ninja generator to list both the .exe and .lib files as outputs of executable build targets. Ninja would always re-link executables with ENABLE_EXPORTS because the .lib output file was not present, and therefore the target was out of date. llvm-svn: 232662
* Making the SO version major.minor instead of just major because ABI and API ↵Chris Bieneman2015-03-021-1/+1
| | | | | | change between minor versions. llvm-svn: 230981
* Minor follow-ups to r229720 suggested on llvmdevReid Kleckner2015-02-271-1/+1
| | | | | | "svn" patch by Sedat Dilek plus trimming whitespace added in r229720. llvm-svn: 230773
* [CMake] Fix the clang-cl self host build.Zachary Turner2015-02-251-1/+5
| | | | | | | | | | | | | | This allows clang-cl to self-host cleanly with no magic setup steps required. After this patch, all you have to do is set CC=CXX=clang-cl and run cmake -G Ninja. These changes only exist to support C++ features which are unsupported in clang-cl, so regardless of whether the user specifies they want to use them, we still have to disable them. llvm-svn: 230539
* CMake: Fix add_lit_target for the case where a test suite has zero target ↵Peter Collingbourne2015-02-181-2/+4
| | | | | | | | | dependencies. This can happen with a standalone project containing a test suite with no internal dependencies. llvm-svn: 229753
* Adding install targets for individual LLVM tools and libraries.Chris Bieneman2015-02-181-2/+20
| | | | | | | | | | | | | | | | | Summary: * add_llvm_tool and add_llvm_library now add install-${name} targets to install specific components * added installhdrs target to install just the LLVM headers * The above changes only apply for single-configuration generators (Ninja, Makefiles...), not for multi-configuration generators (Visual Studio, Xcode...) Reviewers: pete Reviewed By: pete Subscribers: pete, llvm-commits Differential Revision: http://reviews.llvm.org/D7619 llvm-svn: 229727
* Enable standard so versioning for libLLVM.Chris Bieneman2015-02-181-0/+5
| | | | | | | | | | | | | | | | | Summary: This resolves Bugzilla bug 15493. Reviewers: chapuni, pete Reviewed By: pete Subscribers: pete, llvm-commits Differential Revision: http://reviews.llvm.org/D6157 Conflicts: cmake/modules/AddLLVM.cmake llvm-svn: 229720
* Reapply r229185(cbieneman) -- Raising minimum required Visual Studio version ↵NAKAMURA Takumi2015-02-151-6/+0
| | | | | | | | to 2013. This is based on the discussions on: [LLVMdev] [RFC] Raising LLVM minimum required MSVC version to 2013 for trunk llvm-svn: 229320
* Revert r229185, "Raising minimum required Visual Studio version to 2013."NAKAMURA Takumi2015-02-141-0/+6
| | | | | | All builders are not ready yet. llvm-svn: 229199
* Raising minimum required Visual Studio version to 2013.Chris Bieneman2015-02-131-6/+0
| | | | | | This is based on the discussions on: [LLVMdev] [RFC] Raising LLVM minimum required MSVC version to 2013 for trunk llvm-svn: 229185
* [CMake] add_llvm_library: don't use .imp suffix for import libraries on ↵Hans Wennborg2015-02-031-5/+0
| | | | | | | | | | | | | | | | | Windows (PR22334) This was added in r188351 to fix a naming conflict between the profile_rt-static and profile_rt-shared who both ended up in lib/profile_rt.lib. The change also affected other libraries (like libclang), and users are reporting that they find it surprising that there's no longer a libclang.lib. Since the profile_rt naming conflict doesn't seem to exist any more, I think we can remove this. Differential Revision: http://reviews.llvm.org/D7391 llvm-svn: 228049
* Reverting r226937: lit: Make MCJIT's supported arch check case insensitiveKuba Brecka2015-01-241-0/+1
| | | | | | The r226937 commit causes ASan lit tests to be all skipped on OS X. llvm-svn: 226979
* lit: Make MCJIT's supported arch check case insensitiveReid Kleckner2015-01-231-1/+0
| | | | | | | | | Should make the tests run when using CMake on systems where 'uname -p' reports "amd64", such as FreeBSD. Should fix PR21559. llvm-svn: 226937
* Reverting r225319; since there is a folder named Examples, attempting to add ↵Aaron Ballman2015-01-071-6/+0
| | | | | | a target of the same name causes problems for IDEs like Visual Studio. llvm-svn: 225355
* cmake: Fix 'examples' target after r225319Duncan P. N. Exon Smith2015-01-061-1/+1
| | | | | | | | Add the missing `DEPENDS` keyword. r225319 did almost the right thing (I didn't notice the problem with it because `Kaleidoscope-Ch8` wasn't building at all). llvm-svn: 225321
* cmake: Add 'examples' targetDuncan P. N. Exon Smith2015-01-061-0/+6
| | | | llvm-svn: 225319
* [CMake] Silence stderr on "COMMAND ${CMAKE_C_COMPILER} -Wl,--version". It ↵NAKAMURA Takumi2015-01-061-0/+1
| | | | | | was noisy during configuraion. llvm-svn: 225260
OpenPOWER on IntegriCloud