Commit graph

74 commits

Author SHA1 Message Date
Kai Nacke
ed79298915 Merge pull request #1507 from redstar/cmakellvm
LLVM/MSVC: Use library path to search for LLVM libraries.
2016-05-20 23:04:43 +02:00
Kai Nacke
22e2928005 LLVM/MSVC: Use library path to search for LLVM libraries.
For MSVC each LLVM library was prefixed with the absolute path of the
library location. This leads to problems with the command line length.

This PR uses "-LIBPATH:" as link flag for the LLVM libraries and
only appends the suffix .lib to the library names.

It is important to handle the command line options in the right way.
Otherwise spaces in paths may be lost.

A special problem is the automatic conversion of linker options starting
with "-" to "/". If the linker argument does not start with "-" then the
argument is not considered as a link flag. On the other hand if "-" is
used then the prepending of "-L" for LDC does not generate a valid option.
2016-05-20 22:22:38 +02:00
Kai Nacke
41a9dcecea LLVM: Prevent linking error if linking against AMDGPU target.
As usual the AMDGPUUtils library is missing in the list of libraries.
2016-05-20 21:34:22 +02:00
Kai Nacke
4bc9610611 Revert "LLVM: Use /LIBPATH for MSVC"
This reverts commit f35b45b823.
2016-05-20 20:25:33 +02:00
Kai Nacke
f35b45b823 LLVM: Use /LIBPATH for MSVC
For MSVC each LLVM library was prefixed with the absolute path of the
library location. This leads to problems with the command line length.

This PR uses "/LIBPATH:..." as link flag for the LLVM libraries and
only appends the suffix .lib to the library names.
2016-05-19 22:46:27 +02:00
Johan Engelen
bff4d46f1b [CMake] Allow relative paths for D_COMPILER
Resolves #1495
2016-05-18 19:18:15 +02:00
Kai Nacke
cb0f2e7e6a Fix space handling for different paths.
E.g. on my machine LLVM is installed in folder C:\My Program Files\LLVM.

Fixes part of issue #1465. (PR 1466 is required for complete fix.)
2016-05-16 00:12:27 +02:00
Johan Engelen
3b5e8a9a70 [cmake] Allow specification of D_COMPILER on CMake cmdline.
Use with `cmake -DD_COMPILER=ldmd2`. Resolves issue #1320
2016-05-03 21:59:48 +02:00
Johan Engelen
b025e37bbd Also match LLVMTableGen when full paths are used. Fixes build. 2016-03-21 19:36:47 +01:00
Kai Nacke
a2b74aad0b Merge branch 'ltsmaster' 2016-03-21 18:09:17 +01:00
Johan Engelen
febfcad3a2 Add "built with D compiler version" to --version output. 2016-03-21 14:13:30 +01:00
Kai Nacke
c987863b60 LLVM: Add -lLLVMTableGen if linking against shared LLVM library
The problem is that `llvm-config --libs tablegen` returns `-lLLVM-3.8.0` but the
code of the tablegen component is not included in this library.
Current solution is to add `-lLLVMTableGen` to the list of libraries.
2016-03-18 18:11:13 +01:00
Kai Nacke
6e0badadf1 Merge remote-tracking branch 'origin/ltsmaster' 2016-03-13 16:44:07 +01:00
Kai Nacke
1af1d07cde LLVM 3.9: Add new library globalisel 2016-03-12 15:23:53 +01:00
Johan Engelen
a56df03772 Fix FindDCompiler.cmake script: before, the script would find a previously built LDC from the install prefix path. 2016-02-21 16:07:07 +01:00
Kai Nacke
c622cef500 Merge branch 'master' into merge-2.069 2016-02-20 21:02:32 +01:00
Kai Nacke
e9b2b46540 FindLLVM: Add new search path for LLVM 3.9 2016-02-20 20:45:45 +01:00
Johan Engelen
b017facbcd Add one "LDC builds LDC" to Travis. 2016-02-18 13:49:24 +01:00
Johan Engelen
acdcc4a8c1 Merge branch 'master' into merge-2.069 2016-02-13 20:12:17 +01:00
Kai Nacke
1672216cc2 Add gccbuiltins_*.di for more supported targets.
These are: AArch64, ARM, Mips, PowerPC, SystemZ and X86.
2016-02-07 21:17:53 +01:00
Kai Nacke
998510424c cmake: Remove old dependencies from FindLLVM and ...
add support for new component debuginfocodeview.
2016-01-30 00:53:36 +01:00
Johan Engelen
29ce4012af dmd2 --> ddmd. Merge (almost all of) our changes to dmd source into the new D source of dmd 2.069.2.
Also adds the CMake infrastructure to compile and link the D source files.

The build is partially broken:
- A few files in Phobos and druntime do not build
- MSVC build is broken because of unresolved symbols involving reals
2016-01-28 19:03:58 +01:00
Dan Olson
0b63c58a8b cmake: Detect if llvm assertions enabled
Set cmake var LLVM_ENABLE_ASSERTIONS based on llvm-config
--assertion-mode.
2016-01-20 22:22:47 -08:00
Kai Nacke
4d906ec336 Add support for LLVM 3.9 in FindLLVM.cmake 2016-01-17 09:55:37 +01:00
Kai Nacke
4d44c3e961 Fix linking with LLVM shared libraries.
Uses llvm-config --libs and special treatment for TableGen library.
2015-10-09 23:03:38 +02:00
Kai Nacke
992fc7b318 Autodetect LLVM 3.8. 2015-10-09 22:58:48 +02:00
Kai Nacke
5bdfce69ec Remove component ipa if building LDC with LLVM 3.8.
This fixes issue #1125.
2015-09-26 18:14:42 +02:00
Kai Nacke
f104af4462 Revert "LLVM 3.7: Add new component mir"
This reverts commit f1c3c3a81f.

The LLVM commit was reverted.
2015-05-23 02:10:15 +02:00
Kai Nacke
f1c3c3a81f LLVM 3.7: Add new component mir 2015-05-22 21:42:41 +02:00
Kai Nacke
7c835c2738 2nd try at issue #874.
The problem from issue #874 has another variant:
If .git/logs/refs/heads/merge-2.067 exists then this ref is
returned as hash value(!). This is plain wrong. Solution is
again to look up `.git/packed-refs`.
2015-03-28 19:01:48 +01:00
kai
3a6d7bad96 Fix for issue #874.
After running `git gc` cmake may fail to configure the build.
`git gc` deleted the file `.git/refs/head/merge-2.067` (my current branch) and
moved the reference into file `.git/packed-refs`. This file is not parsed for
the reference.

Solution is (a) parse `.git/packed-refs` if ref is not found or (b) use

    git rev-parse --symbolic-full-name HEAD

to get the reference and

    git show-ref --hash ${HEAD_REF}

to get the hash.

This commits uses solution (a).
2015-03-28 18:20:45 +01:00
Dan Olson
73df563a3a Fix cmake bug when ldc is a submodule
Allow ldc to be a submodule.  This uses changes from
https://github.com/rpavlik/cmake-modules.

(cherry picked from commit 0be5ead42e6049f8e51453a82a17b1770646a1a2)
2015-03-09 00:13:54 -07:00
kai
e4b0afb3c2 Add llvm-config-3.7 to list of names 2015-02-17 23:32:18 +01:00
kai
c04537903e LLVM 3.7: Component DebugInfo is now named DebugInfoDWARF.
It's only a change in the build system. This is in preparation for PDB debug info.
2015-02-03 07:11:16 +01:00
Kai Nacke
10be3b836c Fix mingw build script.
LLVM 3.5 requires use of C++11. The gcc compiler requires a flag to use C++11.
The easiest way to pass this flags is to uses the flags returend by llvm-config.
Using llvm-config with mingw requires some path fiddeling because of the mixed
Windows and Unix conventions.
2014-11-04 06:36:39 +01:00
Kai Nacke
1d7e08cb67 Merge pull request #745 from redstar/libconfig
Use C version of libconfig.
2014-10-14 06:57:52 +02:00
kai
2e7a6d43ac Use C version of libconfig.
libconfig++ is only a thin wrapper around libconfig. Because of the
use of exception handling this wrapper requires more memory than needed.
As we have our own wrapper (ConfigFile) just drop the C++ stuff.
2014-10-12 21:59:24 +02:00
Toby Chen
0840bccfab Work around for LLVM not including AArch64Utils
Similar to LLVM bug 21016, the LLVMAArch64Utils.lib is also missing form
the llvm cmake config script when building on MSVC.
2014-10-12 15:30:55 -04:00
Andreas Hollandt
a2e53feaec fix CMP0054 policy warnings 2014-10-02 14:36:51 +02:00
kai
c27f5a5c9f Work around for LLVM bug 21016.
LLVMX86Utils is missing from target library list for target X86.
Affects only MSVC build.
2014-09-27 02:05:20 +02:00
Kai Nacke
813d514243 Fix deprecation warning 2014-09-21 00:12:34 +02:00
Kai Nacke
76281458db Several changes to CMakeLists.txt and FindLLVM.cmake
- Fix typo in comment
- Removes traces from LLVM 3.0 support
- Fix the regular expression used to match LLVM version
- Add support for LLVM 3.6 config tool
2014-09-21 00:10:59 +02:00
Guillaume Ballet
eb32c672a4 Make sure LLVM_LDFLAGS doesn't contain any new line as this breaks the build 2014-07-28 16:09:28 +02:00
Andreas Hollandt
8af29baeda fix #667 flags list used as string
enable function and data sections
fix incorrect library search paths
2014-07-17 00:11:08 +02:00
kai
829839be4a Merge branch 'master' into merge-2.064 2014-06-04 06:45:12 +02:00
Kai Nacke
0d6c556e50 Add alternative llvm-config names.
FreeBSD/PC-BSD has a different naming scheme for multiple LLVM
installations.
2014-06-04 06:41:04 +02:00
Kai Nacke
8bcfbcf692 Merge pull request #600 from klickverbot/system-libs-3.5
FindLLVM: Pick up system libraries on LLVM 3.5+.
2014-05-10 22:35:36 +02:00
Kai Nacke
535221e16d Add llvm-config-3.5 to search list 2014-01-02 15:57:49 +01:00
Kai Nacke
d4f8092dde Support LLVM 3.5.
LLVM 3.5 adds a new required component lto.
2013-12-13 07:41:22 +01:00
David Nadlinger
66484b580a Simplify git_describe to work on CMake 2.8.0.
FindGit doesn't seem to work as expected on Ubuntu 10.04
(GIT-NOTFOUND even though Git is installed and available
on the $PATH).

This implementation might be overly simplistic and it
should probably use find_program() to locate Git. We need
to revisit this after the 0.12.0 release is out.
2013-10-21 23:35:28 +02:00