How to compil project files under the platform?
-
Using RAD Studio XE8. There's a Win and Android project.
Can a compilation be designed so that
unit
or.cpp
Not compiled under Android, but compiled for Win and vice versa?
-
Yes, I can. I'm not sure I'm gettin' to turn it off, but it's a lot to cut.
The method will work from XE5.
There have long been special type comments in the files that work as a conditional compilation directive. And that's it. http://docwiki.embarcadero.com/RADStudio/Seattle/en/Conditional_compilation_(Delphi) a compilation can be defined under the android. I mean, if you need a certain piece of the code to be compiled only under the Android, write it that way.
// эта строка будет компилировать и работать везде {$IF ANDROID} //только под адндроидом {$ENDIF } // и снова везде.
You can.
// работает везде {$IF ANDROID} // только под адроид {$ELSE} // везде кроме андроида {$ENDIF} // снова везде
Thus, the necessary pieces of code may be deleted/additioned. I even found an example. https://github.com/remobjects/EUnit/blob/c4d17da6fd57d006bf37f486e1a1e6496a0f4d96/Sources/Discovery/Discovery.pas ♪
S++ should work with
#ifdef
classically.And now, about "Is there any way to clean up the compilation file?" I think if in dproj (or what's the name of the project file now?) such directives take the file, everything has to come out. But I'm not sure.