Issue 10 in swtoolkit: ComponentTestProgram() should not remove _WINDOWS from CPPDEFINES

5 views
Skip to first unread message

codesite...@google.com

unread,
Nov 30, 2009, 9:04:26 PM11/30/09
to swto...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 10 by ddor...@google.com: ComponentTestProgram() should not
remove _WINDOWS from CPPDEFINES
http://code.google.com/p/swtoolkit/issues/detail?id=10

What steps will reproduce the problem?
1. Create a test program using ComponentTestProgram() that links with a lib
that is also part of the product.
2. Optionally, enable precompiled headers (MSVC).
3. Run hammer.

What is the expected output? What do you see instead?
The build should succeed without recompiling the lib or failing.

What version of the product are you using? On what operating system?
0.9.1
Windows
MSVC 2005

Please provide any additional information below.
When I followed the steps above, Igot a compile error because "'/D_WINDOWS'
specified for precompiled header but not for current compile". By default,
using ComponentTestProgram() causes _WINDOWS to be removed from CPPDEFINES.
I found this in the source and documentation:
http://code.google.com/p/swtoolkit/wiki/Glossary#COMPONENT_TEST_SUBSYSTEM_W
INDOWS. I understand why LINKFLAGS gets changed - we have similar code in
our build.scons, but it does not seem correct to change CPPDEFINES. There
are at least two problems with doing so:
* This causes all code to be recompiled when building tests, which means
the tested code could potentially be different from the product code
* Build errors when using recompiled headers.

The workaround is to define COMPONENT_TEST_SUBSYSTEM_WINDOWS in the
environment before calling ComponentTestProgram(), but I think the
CPPDEFINES change should be removed by default.

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings
Reply all
Reply to author
Forward
0 new messages