Skip to content

Commit

Permalink
Pedantic C compilation and version macros
Browse files Browse the repository at this point in the history
* Adds compiler flags to enable pedantic compilation,
  use the C99 standard, use position independent code for
  64-bit architectures, and enable all warning levels.
* Specifies the watchdog library version numbers as C
  preprocessor macros passed to the C source code.
* Adds `libm` as a library to link against. This should
  have been default for gcc.

Signed-off-by: Gora Khargosh <gora.khargosh@gmail.com>
  • Loading branch information
gorakhargosh committed Dec 29, 2010
1 parent 483bb21 commit 9478d60
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions setup.py
Expand Up @@ -56,15 +56,31 @@
else:
platform = None

_watchdog_fsevents_sources = [
os.path.join(SRC_DIR, '_watchdog_fsevents.c'),
os.path.join(SRC_DIR, '_watchdog_util.c'),
]

ext_modules = {
PLATFORM_MACOSX: [
Extension(name='_watchdog_fsevents',
sources=[os.path.join(SRC_DIR,
'_watchdog_fsevents.c'),
os.path.join(SRC_DIR,
'_watchdog_util.c')],
sources=_watchdog_fsevents_sources,
libraries=['m'],
define_macros=[
('WATCHDOG_VERSION_STRING', version.VERSION_STRING),
('WATCHDOG_VERSION_MAJOR', version.VERSION_MAJOR),
('WATCHDOG_VERSION_MINOR', version.VERSION_MINOR),
('WATCHDOG_VERSION_BUILD', version.VERSION_BUILD),
],
extra_link_args=['-framework', 'CoreFoundation',
'-framework', 'CoreServices']
'-framework', 'CoreServices'],
extra_compile_args=[
'-std=c99',
'-pedantic',
'-Wall',
'-Wextra',
'-fPIC',
]
),
],
}
Expand Down

0 comments on commit 9478d60

Please sign in to comment.