Hey, I use a Pre-build event to call an external compiler to compile an opencl kernel. This way i get all the errors messages inside the ide. But if you only change the kernel, the compiler is not required to run so there is no pre-build event, even if the kernel compile command would generate an error. So is there a way to run the command before you execute your program instead? Like a Pre-Run event ;)
Asked
Active
Viewed 465 times
1 Answers
0
You can have your pre-build target add the item to the inputs list I think it is. Once Visual studio is clued in to check those files for modification, it will know to trigger your Target. I'm not sure that it will actually Invoke a pre-build, so you may want to hook into another target as a
BeforeTargets
attribute.Your project file will typically have a
Imports
on some targets files, that should give you somewhere to start searching for which Target is appropriate.Another possibility is to add your target to the default targets list at the top of the proj file.
how-to-invoke-the-same-msbuild-target-twice-with-different-parameters-from-within reference may help.