Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Volker_Bruns
Beginner
74 Views

how to pass -D preprocessor define to VS 2010 offline compiler plugin?

Hi,

good job on the SDK, intel! I am using the 2013 SDK version with the plugin for Visual Studio 2010.

in my cl code, I want to be able to do this:

#ifdef NAMEOFDEFINE
//some work
#endif

How do I define NAMEOFDEFINE?
I tried -D NAMEOFDEFINE, -DNAMEOFDEFINE, -D NAMEOFDEFINE = 1, -DNAMEOFDEFINE=1 both in the project's Intel SDK property sheet's "additional build option" field and in the command line's "additional options" field, but to no avail. If I specify it in the project settings, it does show up in the individual cl file's settings as well, as expected. However, when I offline-compile the file, the output window log echos the used build options ("Using build options:"), but only the -I includes are listed, not my custom -D parameter.

What am I missing? Looking forward to your insights.
Cheers

0 Kudos
3 Replies
Oded_P_Intel
Employee
74 Views

Hi,

 

Please add this line:

OTHER="%(Intel_OpenCL_Build_Rules.OTHER)"

after this line (88):

IR="%(Intel_OpenCL_Build_Rules.IR)"

In the file IntelOpenCL.targets located in “C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations”

Please make sure you don’t erase any line from the original file and keep the indentation.

This should fix the issue for every project you create after this fix is applied.

This fix will be included in the next Intel® SDK for OpenCL* Applications.

 

Best Regards,

Oded

 

Oded_P_Intel
Employee
74 Views

BTW, this will also fix existing projects, but you will need to re-open them in Visual Studio.
 
Best Regards,
Oded

Volker_Bruns
Beginner
74 Views

works like a charm. Thanks!