[SR-8818] Allow values for compilation flags (-DPARAMETER='“a string”') #51326
Labels
compiler
The Swift compiler in itself
feature
A feature request or implementation
swift evolution proposal needed
Flag → feature: A feature that warrants a Swift evolution proposal
Additional Detail from JIRA
md5: f8119f3bd3d2e0c08396d510a15e15b0
Issue Description:
For things like build dates and times and parameters that could come from build configurations it could be useful to be able to provide values for compilation flags as you can with the C compiler for example:
swift -DBUILD_NUMBER=1234 -DTOLLERANCE=0.9 -DBUILD_DATE=‘"Sun 23 Sep 2018 11:47:20”’ file.swift
I have in mind a simple implementation that these parameters would have module scope and be just substituted when the parameter name was referred to as if the user had typed them. A straight forward implementation intercepting identifiers in the Lexer is available here johnno1962#1
The text was updated successfully, but these errors were encountered: