Commit graph

43 commits

Author SHA1 Message Date
Richard (Rikki) Andrew Cattermole
6da6066bf1
Fix dub file for dscanner (#20978) 2025-03-12 07:29:09 +08:00
Vladiwostok
4a90885ef8 Fix dub recipe for the lexer subpackage 2024-10-26 18:17:47 +02:00
Nicholas Wilson
4e175352af Move driver's lib files into a package 2024-10-02 21:47:29 +08:00
Nicholas Wilson
392a5925ea Fix dub.sdl for DMD as a Libaray 2024-10-02 20:34:47 +08:00
Martin Kinkelin
15d01829af dub build: Fix cross-compilation
The build of the lexer dub subpackage requires running and building
a little config.d tool as custom pregenerate command.

Forwarding the target architecture via `--arch=$DUB_ARCH` to the
nested dub build of config.d was added in #9275, to fix cross-
compilation, but in reality broke it.

Not specifying the architecture explicitly for the little helper
build lets the compiler pick the default one, the host's native
platform in practice, which is guaranteed to be runnable on that
compiling **host**, independent from the **target** platform for
the main dub build. Suppose one cross-compiles the dmd:lexer
subpackage from x86_64 to AArch64 - an AArch64 config.d executable
will hardly run on the x86_64 host, and won't be able to generate
the `VERSION` and `SYSCONFDIR.imp` string-import files as pre-
requisite of the build.

Side note: using little separately-built .d tools/scripts as build
helpers for autogenerating little VERSION files etc. is IMO bad
practice - when cross-compiling, you require a D compiler that can
a) cross-compile, and b) build successfully for the native platform
too. Not sure this approach will e.g. ever work with GDC, where you
have different toolchains for each host->target combination.
2024-07-28 09:01:09 +08:00
Martin Kinkelin
d715bdc972 Get rid of obsolete dmd.{lib,scan}omf modules 2024-05-25 16:25:35 +02:00
Dennis Korpel
59f37858bf Fix dip1000 errors in blake3.d 2024-03-13 20:24:43 +08:00
Iain Buclaw
e367663549
Remove dmd.iasm from the gluelayer module (#16182) 2024-02-13 14:21:18 +02:00
dkorpel
edbc819e06 Add building dmd with dub 2024-02-02 20:52:10 +01:00
Razvan Nitu
dd4fbf43f0
Fix Issue 23838 - DMD lexer / parser examples might not compile (#15106) 2023-04-17 15:57:30 +03:00
Walter Bright
a852b8ec82 extricate location.d into its own file 2022-12-25 06:32:05 +01:00
Iain Buclaw
09d04945bd Fix build script paths to work with new merged repository structure
Co-Authored-By: Geod24 <pro.mathias.lang@gmail.com>
Co-Authored-By: Martin Kinkelin <noone@nowhere.com>
Co-Authored-By: Vladimir Panteleev <git@cy.md>
2022-07-09 23:49:27 +02:00
Iain Buclaw
de5ca94061 Move dmd.utf to the root library 2021-12-30 21:58:50 +00:00
Harrison
469890bac1
Rip out FileCache and replace with FileManager (#13193) 2021-10-27 09:51:19 +03:00
Andrei Alexandrescu
a7ab922b28 Pull OutBuffer into dmd.common and use it from both frontend and backend 2021-10-21 13:35:25 -04:00
MoonlightSentinel
7b29884001 Sync string import paths in dub.sdl 2021-04-16 10:36:05 +08:00
Mihaela Chirea
2cdc53fe47 Added offset to Loc 2020-10-19 10:24:09 +03:00
Walter Bright
e008ca1df7 move res/ subdirectory to src/dmd/res/ 2020-06-15 13:31:07 +02:00
Cristian Creteanu
2efa524275
Add dmd as a lib callbacks for statement semantic (#11092)
Add dmd as a lib callbacks for statement semantic
merged-on-behalf-of: Razvan Nitu <RazvanN7@users.noreply.github.com>
2020-06-07 15:32:10 +02:00
GoaLitiuM
ff944fcd0f Dub: Exclude root, lexer and parser source files from frontend 2019-11-13 10:22:32 +02:00
Martin Kinkelin
01d69f2148 Dub: Exclude static libs & binaries generation from frontend subpackage 2019-11-02 16:16:00 +01:00
Martin Kinkelin
c3b1373afd Exclude 2 codegen-related files from dub frontend subpackage
These import backend modules, and that leads to undefined symbol
regressions (backend TypeInfos referencing undefined backend init
symbols) with LDC on Windows for current master (stable is fine).
See https://github.com/ldc-developers/ldc/issues/3212.
2019-11-02 15:19:24 +01:00
Jacob Carlborg
f80c3f3a85 Add unit test runner.
This will allow to use the compiler as a library to implement more
unit test like tests. These tests will be able to inspect the
internals of the compiler to perform new kinds of tests that are not
possible today.

Unit tests live in the `test/unit` directory. They are written using
the built-in `unittest` blocks. The unit test framework supports
callbacks executed before and after each test. The unit test runner
allows to limit the tests executed either by file(s) and/or by UDAs.
Example:

```d
module self_test;

import support : afterEach, beforeEach;

@beforeEach initializeFrontend()
{
    import dmd.frontend : initDMD;
    initDMD();
}

@afterEach deinitializeFrontend()
{
    import dmd.frontend : deinitializeDMD;
    deinitializeDMD();
}

@("self test")
unittest
{
    import std.algorithm : each;
    import dmd.frontend;

    findImportPaths.each!addImport;

    auto t = parseModule("test.d", q{
        int a = 3;
    });

    assert(!t.diagnostics.hasErrors);
    assert(!t.diagnostics.hasWarnings);
}
```

* To run all unit tests, run: `./run.d -u`
* To run only the unit tests in a single file, run: `./run.d -u unit/self_test.d`
* To run only the unit tests matching a UDA, run: `./run.d -u --filter "self test"`
2019-02-09 11:57:14 +01:00
Jacob Carlborg
ca4f0d78af Reduce long lines in the Dub file 2019-01-21 12:37:51 +01:00
Jacob Carlborg
65bd76713c Fix Dub package when cross-compiling
The pre generate commands were using the native platform instead of
target platform.
2019-01-21 12:37:51 +01:00
Sebastian Wilzbach
4787d4b449 Generate expressive diagnostic messages 2018-12-18 15:51:03 +01:00
Jacob Carlborg
71e2660171 Fix building the Dub frontend package on Windows
The Dub package was unconditionally running the `config.sh` shell
script to generate the `VERSION` file. A Bash shell script will not
work on Windows. Therefore the `config.sh` script has been ported to
D, which will work on both Windows and Posix.
2018-11-03 12:03:33 +01:00
Jacob Carlborg
c92ed7cf93 Fix building Dub package on Windows due to duplicated symbols
Building the Dub package on Windows results in the following
duplicated symbols: `?backend_init@@YAXXZ` and `?backend_term@@YAXXZ`.
This is solved by excluding the `dmsc.d` file from the Dub package.
The `backend_init` and `backend_term` symbols are both defined in
`gluelayer.d` (when the `NoBackend` version is defined) and `dmsc.d`.
2018-10-28 12:51:52 +01:00
Iain Buclaw
dad81c06bc Implement GccAsmStatement for gcc-style asm statements 2018-08-14 08:10:40 +02:00
Iain Buclaw
b3c08210e1 Move main implementation of AsmStatement to InlineAsmStatement 2018-08-14 08:10:40 +02:00
Iain Buclaw
50625d9441 Move dmd/iasm.d to dmd/iasmdmd.d 2018-08-14 08:10:40 +02:00
Sebastian Wilzbach
3ba4d859e5 Add version MARS to the DUB DMD frontend package 2018-02-12 16:23:35 +01:00
Sebastian Wilzbach
2eba84d79b Manually update copyright years of dub.sdl 2018-01-01 18:46:55 +01:00
Sebastian Wilzbach
9fb19e7a01 Version platform-specific files 2017-12-31 14:59:35 +01:00
Sebastian Wilzbach
bb0161d173 Use sourcePaths and excludeSourceFiles 2017-12-19 08:41:06 +01:00
Sebastian Wilzbach
e88073d788 Add frontend module and example 2017-12-19 08:41:06 +01:00
Sebastian Wilzbach
b203430b1b Expose D frontend via DUB 2017-12-19 06:44:02 +01:00
Sebastian Wilzbach
ed9a730082 Rename ddmd text occurrences
sed -i "s/ddmd/dmd/g" -i **/*.sdl
sed -i "s/ddmd/dmd/g" -i **/*.mak
sed -i "s/ddmd/dmd/g" -i **/*.visualdproj
sed -i "s/ddmd/dmd/g" -i **/*.vcxproj
sed -i "s/ddmd/dmd/g" -i **/*.filters
sed -i "s/ddmd/dmd/g" -i CODEOWNERS
2017-12-15 03:29:35 +01:00
Sebastian Wilzbach
b9a930abf2 Start testing the DMD DUB package on Travis 2017-12-11 04:00:01 +01:00
Sebastian Wilzbach
b63b1db450 Reassign copyright from Digital Mars to The D Language Foundation (manual) 2017-12-05 02:19:32 +01:00
RazvanN7
8a9cbb15a4 Upgrade dub.sdl file 2017-11-01 12:03:06 +02:00
Martin Nowak
09cc628724 factor out config.sh script to update config files (VERSION, SYSCONFDIR)
- use generated/dub as string import path for copied/generated config files
2017-07-27 13:54:41 +02:00
Jacob Carlborg
b5e6ed443d Fix issue 17392 - Add Dub file for the lexer and parser
The Dub file is intended to make the the compiler available as a
library through Dub.
2017-07-16 16:18:50 +02:00