1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00
Commit Graph

24 Commits

Author SHA1 Message Date
Eric Fiselier
b7e38c5c8a [CMake] Add LLVM_ENABLE_IDE option to better process sources for IDE's
Summary:
Currently LLVM has no way to support configuring for IDE's like CLion. Like XCode and MSVC's IDE, CLion needs to see all of the headers and tablegen files in order to properly parse the sources.

This patch adds an `LLVM_ENABLE_IDE` option which can be used to configure for IDE's in general. It is used by `LLVMProcessSources.cmake` to determine if the extra source files should be added to the target.

Unfortunately because of the low level of `LLVMProcessSources.cmake`, I'm not sure where the `LLVM_ENABLE_IDE` option should live. I choose `HandleLLVMOptions.cmake` so that out-of-tree Clang builds would correctly configure the option by default.



Reviewers: beanz, mgorny, lebedev.ri

Reviewed By: beanz

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D40219

llvm-svn: 322349
2018-01-12 04:01:41 +00:00
Shoaib Meenai
146d976672 [cmake] Add SOURCE_DIR argument to llvm_check_source_file_list
The motivation is to be able to check sources outside the current
directory. See D31363 for example usage.

Differential Revision: https://reviews.llvm.org/D37859

llvm-svn: 313648
2017-09-19 17:44:42 +00:00
Zachary Turner
a8bf06418d Teach llvm_add_library() to find include dirs.
Since header files are not compilation units, CMake does not require
you to specify them in the CMakeLists.txt file.  As a result, unless a
header file is explicitly added, CMake won't know about it, and when
generating IDE-based projects, CMake won't put the header files into
the IDE project.  LLVM currently tries to deal with this in two ways:

  1) It looks for all .h files that are in the project directory, and
     adds those.
  2) llvm_add_library() understands the ADDITIONAL_HEADERS argument,
     which allows one to list an arbitrary list of headers.

This patch takes things one step further.  It adds the ability for
llvm_add_library() to take an ADDITIONAL_HEADER_DIRS argument, which
will specify a list of folders which CMake will glob for header files.
Furthermore, it will glob not only for .h files, but also for .inc
files.

Included in this CL is an update to one of the existing users of
ADDITIONAL_HEADERS to use this new argument instead, to serve as an
illustration of how this cleans up the CMake.

The big advantage of this new approach is that until now, there was no
way for the IDE projects to locate the header files that are in the
include tree.  In other words, if you are in, for example,
lib/DebugInfo/DWARF, the corresponding includes for this project will
be located under include/llvm/DebugInfo/DWARF.  Now, in the
CMakeLists.txt for lib/DebugInfo/DWARF, you can simply write:

  ADDITIONAL_HEADER_DIRS
  ../../include/llvm/DebugInfo/DWARF

as an argument to llvm_add_library(), and all header files will get
added to the IDE project.

Differential Revision: http://reviews.llvm.org/D7460
Reviewed By: Chris Bieneman

llvm-svn: 228670
2015-02-10 05:04:37 +00:00
Matt Arsenault
46ad6e6208 cmake: Don't reject unknown cpp files that start with .
Some editors create hidden file backups in the same
directory as the file, and it's annoying when cmake
errors on them.

llvm-svn: 216941
2014-09-02 20:20:43 +00:00
NAKAMURA Takumi
5c9eb49c11 [CMake] LLVMProcessSources.cmake: Prune add_file_dependencies to ${TABLEGEN_OUTPUT}.
I am sure it'd not be required any more.
In trunk, all of tablegen's users depend on ${TABLEGEN_OUTPUT} as not file dependency but inter-target dependency.

llvm-svn: 201063
2014-02-10 03:24:28 +00:00
NAKAMURA Takumi
9c5396cb3d [CMake] Prune CMAKE_CXX_FLAGS stuff in llvm_process_sources.
It is the final step to deprecate contextual CMAKE_CXX_FLAGS.

llvm-svn: 200303
2014-01-28 09:48:19 +00:00
NAKAMURA Takumi
6e967d4af7 [CMake] Let llvm_process_sources check not only *.cpp but also *.c.
llvm-svn: 200298
2014-01-28 09:43:49 +00:00
NAKAMURA Takumi
606154f6fb [CMake] LLVMProcessSources.cmake: Add include(CMakeParseArguments).
I didn't realize that cmake_parse_arguments() would require explicit inclusion.

llvm-svn: 199674
2014-01-20 17:05:49 +00:00
NAKAMURA Takumi
04cae90676 [CMake] llvm_process_sources: Introduce a parameter, ADDITIONAL_HEADERS.
ADDITIONAL_HEADERS is intended to add header files for IDEs as hint.

For example:
  add_llvm_library(LLVMSupport
    Host.cpp
    ADDITIONAL_HEADERS
      Unix/Host.inc
      Windows/Host.inc
    )

llvm-svn: 199639
2014-01-20 10:20:23 +00:00
Jordan Rose
a40af11692 CMake: Include private headers / tablegen files in generated Xcode projects.
llvm-svn: 166503
2012-10-23 21:36:55 +00:00
NAKAMURA Takumi
314fb04947 LLVMProcessSources.cmake: [MSVC] Don't add "PROPERTIES HEADER_FILE_ONLY" to *.def.
FIXME: Shall we put *.def(s) to the folder?
llvm-svn: 159102
2012-06-24 03:50:58 +00:00
Chandler Carruth
f372f64b71 Completely refactor the structuring of unittest CMake files to match the
Makefiles, the CMake files in every other part of the LLVM tree, and
sanity.

This should also restore the output tree structure of all the unit
tests, sorry for breaking that, and thanks for letting me know.

The fundamental change is to put a CMakeLists.txt file in the unittest
directory, with a single test binary produced from it. This has several
advantages:

- No more weird directory stripping in the unittest macro, allowing it
  to be used more readily in other projects.
- No more directory prefixes on all the source files.
- Allows correct and precise use of LLVM's per-directory dependency
  system.
- Allows use of the checking logic for source files that have not been
  added to the CMake build. This uncovered a file being skipped with
  CMake in LLVM and one in Clang's unit tests.
- Makes Specifying conditional compilation or other custom logic for JIT
  tests easier.

It did require adding the concept of an explicit 'optional' source file
to the CMake build so that the missing-file check can skip cases where
the file is *supposed* to be missing. =]

This is another chunk of refactoring the CMake build in order to make it
usable for other clients like CompilerRT / ASan / TSan.

Note that this is interdependent with a Clang CMake change.

llvm-svn: 158909
2012-06-21 09:51:26 +00:00
Oscar Fuentes
51417218c2 Handle gcc-compatible compilers (such as clang) the same way we handle
gcc.

Fixes PR9886.

llvm-svn: 131181
2011-05-11 13:53:08 +00:00
Oscar Fuentes
123864334b Made llvm_replace_compiler_option more robust. Use it on
llvm_process_sources.

llvm-svn: 123232
2011-01-11 12:31:34 +00:00
Oscar Fuentes
fb15f6c494 Don't use -O3 on Mingw, as people report it as unreliable. Use -O2
instead.

llvm-svn: 123028
2011-01-07 20:31:03 +00:00
Oscar Fuentes
bf3f9406c7 LLVMProcessSources: add .def files along with .h files to targets for
the benefit of project-based generators (VS, XCode, etc).

llvm-svn: 122749
2011-01-03 16:59:52 +00:00
Oscar Fuentes
c3becc8af6 Propagate to parent scope changes made to CMAKE_CXX_FLAGS.
llvm-svn: 122692
2011-01-02 12:30:18 +00:00
Oscar Fuentes
2e6eb6e191 CMake (MSVC): cmake automatically adds the /EHsc and /GR compiler
options. If we are building with exceptions/rtti disabled, we replace
/EHsc with /EHs-c- and /GR with /GR-, respectively. If we just add the
disabling options we get warnings like this:

cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'

llvm-svn: 122648
2010-12-31 19:10:49 +00:00
Francois Pichet
2fac2ab94d Disable C++ exception handling on MSVC.
Total size of bin\Release on disk goes from 82.9 MB to 74.2 MB. (~10% saving)

llvm-svn: 120908
2010-12-04 14:30:22 +00:00
Francois Pichet
6aff5fc3be Disable RTTI on Windows.
Total size of bin\Release on disk goes from 83.6 MB to 81.8MB. (~2% saving)

llvm-svn: 120901
2010-12-04 09:42:30 +00:00
Oscar Fuentes
a6ffccab95 Build with RTTI and exceptions disabled. Only in GCC for now.
llvm-svn: 116682
2010-10-17 02:26:16 +00:00
Oscar Fuentes
b3bc38f392 CMake: Report an error if there is an unknown .cpp file in a source
directory.

This is useful in case someone who works with the config&make build
system forgot to add a file to its CMakeLists.txt. Instead of
obtaining undefined references at link time, cmake will complain at
configure time on the first build after a svn update.

llvm-svn: 85817
2009-11-02 19:11:03 +00:00
Oscar Fuentes
9abd2759a2 CMake: Adds header and TableGen files to Visual Studio solution. A new
dummy library, `llvm_headers_do_not_build', is created for containing
all header and TableGen files under include/llvm.

llvm-svn: 59346
2008-11-15 02:08:08 +00:00
Oscar Fuentes
fab3ce2295 CMake: Fixed dependencies of .cpp source files on .td and tablegenned
files.

llvm-svn: 59325
2008-11-14 22:06:14 +00:00