csc task does not handle my preprocessor directive

Alexander op de Weegh <[email protected]> Mon, 21 Oct 2013 13:22:58 +0200
Newsgroups gmane.comp.windows.dotnet.nant.user
Message-ID <86BBBAD92C8DAF4E9D65D9D8B4B5BB0B018D373C1CA7@TPMS01>
Hi all,

I'm having trouble passing pre-processor directives to my csc task. Below is a snippet of my build file:

<property name="defineSymbols" value="DIRECTIVENAME"/>
<csc target="library" output="test.dll" define="${defineSymbols}" platform="AnyCPU">
...
</csc>

Strange to see is that if I include a <echo message="${defineSymbols}"/> task just before the csc task, it echo's DIRECTIVENAME, just as I expected. My code files nevertheless are compiled as if the pre-processor directive isn't set.

If I change the 'define="${defineSymbols}"' to 'define="DIRECTIVENAME"' it all compiles as expected.

Any one any idea?

With kind regards,
Alexander op de Weegh

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135031&iu=/4140/ostg.clktrk