Inno Setup IDE and ISCC/ISPP passing define

2019-07-01 17:12发布

I would like to use both the InnoIDE and ISCC/ISPP, the difference being that I would like to pass in a parameter, which will override a #define in the script.

In the command line I can pass /Dmyarg=myvalue. That is the same as "#define myarg myvalue" in the script.

Sadly, the script takes precedence over the command line value. I know, as I tried. I can obviously comment out the #define in the script and the command line define will work, however then I will not be able to use the IDE to build.

Is it possible to set a #define inside InnoIDE somewhere for the project or is there some means to have the command line #define take precedence?

1条回答
ゆ 、 Hurt°
2楼-- · 2019-07-01 17:35

In your script, do something like this:

#ifndef myarg
# define myarg "mydefault"
#endif

Now, if you compile in the IDE or if you use the command line without specifying /Dmyarg="something", then it will use the default specified in the script. Otherwise, if you do specify something on the command line then it will use that instead.

查看更多
登录 后发表回答