Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
405ac511
Commit
405ac511
authored
Nov 23, 2010
by
Vicent Marti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add --debug flag to toggle debugging
Signed-off-by: Vicent Marti <tanoku@gmail.com>
parent
277e45f4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
5 deletions
+14
-5
wscript
+14
-5
No files found.
wscript
View file @
405ac511
...
...
@@ -2,8 +2,12 @@ from waflib.Context import Context
from waflib.Build import BuildContext, CleanContext, \
InstallContext, UninstallContext
CFLAGS_UNIX = ["-g", "-O2", "-Wall", "-Wextra"]
CFLAGS_WIN32 = ['/TC', '/W4', '/RTC1', '/Zi', '/nologo']
CFLAGS_UNIX = ["-O2", "-Wall", "-Wextra"]
CFLAGS_WIN32 = ['/TC', '/W4', '/RTC1', '/nologo']
CFLAGS_UNIX_DBG = ['-g']
CFLAGS_WIN32_DBG = ['/Zi', '/DEBUG']
CFLAGS_WIN32_L_DBG = ['/DEBUG']
ALL_LIBS = ['z', 'crypto', 'pthread']
...
...
@@ -12,20 +16,24 @@ def options(opt):
opt.add_option('--sha1', action='store', default='builtin',
help="Use the builtin SHA1 routines (builtin), the \
PPC optimized version (ppc) or the SHA1 functions from OpenSSL (openssl)")
opt.add_option('--debug', action='store_true', default=False,
help='Compile with debug symbols')
def configure(conf):
# default configuration for C programs
conf.load('compiler_c')
dbg = conf.options.debug
zlib_name = 'z'
conf.env.CFLAGS = CFLAGS_UNIX
conf.env.CFLAGS = CFLAGS_UNIX
+ CFLAGS_UNIX_DBG if dbg else []
if conf.env.DEST_OS == 'win32':
conf.env.PLATFORM = 'win32'
if conf.env.CC_NAME == 'msvc':
conf.env.CFLAGS = CFLAGS_WIN32
conf.env.CFLAGS += CFLAGS_WIN32 + CFLAGS_WIN32_DBG if dbg else []
conf.env.LINKFLAGS += CFLAGS_WIN32_L_DBG if dbg else []
conf.env.DEFINES += ['WIN32', '_DEBUG', '_LIB', 'ZLIB_WINAPI']
zlib_name = 'zlibwapi'
...
...
@@ -36,7 +44,7 @@ def configure(conf):
conf.env.PLATFORM = 'unix'
# check for Z lib
conf.check(features='c cprogram', lib=zlib_name, uselib_store='z')
conf.check(features='c cprogram', lib=zlib_name, uselib_store='z'
, install_path=None
)
if conf.options.sha1 not in ['openssl', 'ppc', 'builtin']:
ctx.fatal('Invalid SHA1 option')
...
...
@@ -141,6 +149,7 @@ def build_tests(bld):
target=test_name,
includes=['src', 'tests'],
defines=['TEST_TOC="%s.toc"' % test_name],
install_path=None,
stlib=['git2'], # link with the git2 static lib we've just compiled'
stlibpath=[directory.find_node('build/static/').abspath(), directory.abspath()],
use=['test_helper'] + ALL_LIBS # link with all the libs we know
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment