Thread overview
[Issue 23401] ImportC: add -cpp=filename switch to select C preprocessor
[Issue 23401] importc can't select preprocessor
Dec 17, 2022
Iain Buclaw
Apr 09, 2023
Walter Bright
Apr 16, 2023
Walter Bright
Apr 16, 2023
Adam D. Ruppe
Apr 18, 2023
Walter Bright
Apr 18, 2023
Walter Bright
Apr 18, 2023
Dlang Bot
Apr 19, 2023
Dlang Bot
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=23401

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P4

--
April 09, 2023
https://issues.dlang.org/show_bug.cgi?id=23401

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla@digitalmars.com

--- Comment #1 from Walter Bright <bugzilla@digitalmars.com> ---
Actually, dmd cross compiles using the -os=windows, -os=freebsd, etc., switch. I use it all the time.

But you're right, there's a problem with cross-compilation of .c files because how does one run the C preprocessor on another platform?

--
April 16, 2023
https://issues.dlang.org/show_bug.cgi?id=23401

--- Comment #2 from Walter Bright <bugzilla@digitalmars.com> ---
Adam - can you suggest a proposal for how to specify which preprocessor is run?

--
April 16, 2023
https://issues.dlang.org/show_bug.cgi?id=23401

--- Comment #3 from Adam D. Ruppe <destructionator@gmail.com> ---
I'd do a command line switch.

`-importc-cpp=whatever`

sets whatever as the command to use as the preprocessor.

Then copy gdc's

`-Xpreprocessor arg`

to pass extra arguments to the preprocessor.

--
April 18, 2023
https://issues.dlang.org/show_bug.cgi?id=23401

--- Comment #4 from Walter Bright <bugzilla@digitalmars.com> ---
You can currently set the environment variable CPPCMD to the C preprocessor to use.

--
April 18, 2023
https://issues.dlang.org/show_bug.cgi?id=23401

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|importc can't select        |ImportC: add -cpp=filename
                   |preprocessor                |switch to select C
                   |                            |preprocessor

--
April 18, 2023
https://issues.dlang.org/show_bug.cgi?id=23401

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--- Comment #5 from Dlang Bot <dlang-bot@dlang.rocks> ---
@WalterBright created dlang/dmd pull request #15112 "fix Issue 23401 - ImportC: add -cpp=filename switch to select C prepr…" fixing this issue:

- fix Issue 23401 - ImportC: add -cpp=filename switch to select C preprocessor

https://github.com/dlang/dmd/pull/15112

--
April 19, 2023
https://issues.dlang.org/show_bug.cgi?id=23401

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #6 from Dlang Bot <dlang-bot@dlang.rocks> ---
dlang/dmd pull request #15112 "fix Issue 23401 - ImportC: add -cpp=filename switch to select C prepr…" was merged into master:

- f79a7a4b68f5f7cbfef58249f4c9be7a98b699cd by Walter Bright:
  fix Issue 23401 - ImportC: add -cpp=filename switch to select C preprocessor

https://github.com/dlang/dmd/pull/15112

--