New compiler conditionals avoid compiling code for unneeded services

6 views
Skip to first unread message

Greg Robbins

unread,
Aug 3, 2009, 6:27:47 PM8/3/09
to gdata-objec...@googlegroups.com
I have checked changes into the top-of-trunk in subversion to let applications easily choose to include code just for the Google Data API services they are using. All unneeded classes will be excluded at compile time.

This should reduce code size for all applications, dramatically so for applications that have not custom-tailored their included source files. For example, the Framework executable built debug is reduced from 4 MB with sources for all services (Calendar, Contacts, Docs, and so on) to 1 MB with sources for no specified services.

The conditional flags in each source file look something like this:

  #if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_CONTACTS_SERVICE

So if your project is building on the top-of-trunk sources, in either the project file settings for compile flags or in your project config file, set GDATA_REQUIRE_SERVICE_INCLUDES to 1, along with the services you are using. For example,

  -DGDATA_REQUIRE_SERVICE_INCLUDES=1 -DGDATA_INCLUDE_CONTACTS_SERVICE=1

Your next build should be smaller and faster.


The change is checked in at http://code.google.com/p/gdata-objectivec-client/source/detail?r=305

Reply all
Reply to author
Forward
0 new messages