diff options
author | Petteri Aimonen <jpa@git.mail.kapsi.fi> | 2013-09-10 12:39:39 +0300 |
---|---|---|
committer | Petteri Aimonen <jpa@git.mail.kapsi.fi> | 2013-09-10 12:39:39 +0300 |
commit | e681dd0d75a4b6a7974cc898477f3a138f7872c2 (patch) | |
tree | d6ef45c88d9e69bae390b2d88738a7d55b161c40 /tests/SConstruct | |
parent | 4dccf28ba9c212b232147fd3823554d04b30c392 (diff) |
Add an example pb_syshdr.h file for platforms without C99.
This allows building the tests easily on Visual C++ in C mode.
Also add checks to pb.h that the defined integer types are of
the proper sizes. This may prevent some difficult to debug problems
later..
Diffstat (limited to 'tests/SConstruct')
-rw-r--r-- | tests/SConstruct | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/SConstruct b/tests/SConstruct index b2d524cc..a690aff0 100644 --- a/tests/SConstruct +++ b/tests/SConstruct @@ -12,6 +12,13 @@ env.Append(PROTOCPATH = ['#../generator', '/usr/include', '.']) # Define the include path to find nanopb.proto env.Append(PROTOCPATH = ['#../generator', '/usr/include', '.']) +# If the platform doesn't support C99, use our own header file instead. +conf = Configure(env) +if not conf.CheckCHeader('stdbool.h'): + conf.env.Append(CPPDEFINES = {'PB_SYSTEM_HEADER': '\\"pb_syshdr.h\\"'}) + conf.env.Append(CPPPATH = "#../compat") +env = conf.Finish() + # Now include the SConscript files from all subdirectories SConscript(Glob('*/SConscript'), exports = 'env') |