How can I define macros for the .mmp file on Symbian?
Article Metadata
Compatibility
S60 2nd Edition
Article
Overview
How can I define macros for the .mmp file?
Description
Is it possible to define macros on the command line so that they can be used in .mmp, .pkg, resource, and C++ files?
Solution
Macros used in C++ files can be defined using the MACRO keyword in the .mmp file. However, those macros are only used by the C++ precompiler. It is not possible to define macros in the command line to be used with bldmake and abld script.
To define global macros that can be used with .mmp, resource, and C++ files, you can create a header file.
--- macros.h ---
#ifndef MACROS_H
#define MACROS_H
#define MACRO1
#define MACRO2
#endif
--- macros.h ends ---
The header file can be included in .mmp, .rss, and C++ files and macros can be used as usually:
#if defined(MACRO1)
...do something
#else
...do something
#endif
Unfortunately .pkg files use a different syntax and header files cannot be included. See the SDK Help for "Package file format .pkg".


(no comments yet)