summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDwayne C. Litzenberger <dlitz@dlitz.net>2009-10-11 02:04:38 -0400
committerDwayne C. Litzenberger <dlitz@dlitz.net>2009-10-12 14:53:59 -0400
commitafbaf76c8c38147a827935293fb9b93a77095cbd (patch)
tree9a7c775ac98d2b01cba38c7e9a50a0bb6e8e3785
parent4ad1cd62169a59dc91c572925c259562c3e3b08a (diff)
downloadpycrypto-afbaf76c8c38147a827935293fb9b93a77095cbd.tar.gz
setup.py: Add USE_GCOV variable for building with gcov
-rw-r--r--setup.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/setup.py b/setup.py
index b0f95a7..d8c8307 100644
--- a/setup.py
+++ b/setup.py
@@ -58,6 +58,10 @@ else:
HTONS_LIBS = []
plat_ext = []
+# For test development: Set this to 1 to build with gcov support.
+# Use "gcov -p -o build/temp.*/src build/temp.*/src/*.gcda" to build the .gcov files
+USE_GCOV = 0
+
# List of pure Python modules that will be excluded from the binary packages.
# The list consists of (package, module_name) tuples
from distutils.command.build_py import build_py
@@ -134,6 +138,10 @@ class PCTBuildExt (build_ext):
self.__add_compiler_option("-fomit-frame-pointer")
# Don't include debug symbols unless debugging
self.__remove_compiler_option("-g")
+ if USE_GCOV:
+ self.__add_compiler_option("-fprofile-arcs")
+ self.__add_compiler_option("-ftest-coverage")
+ self.compiler.libraries += ['gcov']
# Call the superclass's build_extensions method
build_ext.build_extensions(self)