Get rid of cryptopp dependency
Plus various code cleanups:
* More 'auto' usage
* Use 'nullptr' instead of 0
* Rename NewApp class to ChronoChatApp
* Print exception info with boost::diagnostic_information()
* Disable -Wdeprecated-copy and -Wredundant-tags, they trigger
too many warnings in Qt headers with gcc 9 and later
Change-Id: I2ea16c19be634f957b59280c704a956f083891f0
diff --git a/.waf-tools/cryptopp.py b/.waf-tools/cryptopp.py
deleted file mode 100644
index b61c0bf..0000000
--- a/.waf-tools/cryptopp.py
+++ /dev/null
@@ -1,77 +0,0 @@
-#! /usr/bin/env python
-# encoding: utf-8
-
-'''
-
-When using this tool, the wscript will look like:
-
- def options(opt):
- opt.tool_options('cryptopp', tooldir=["waf-tools"])
-
- def configure(conf):
- conf.load('compiler_cxx cryptopp')
-
- def build(bld):
- bld(source='main.cpp', target='app', use='CRYPTOPP')
-
-Options are generated, in order to specify the location of cryptopp includes/libraries.
-
-
-'''
-import sys
-import re
-from waflib import Utils,Logs,Errors
-from waflib.Configure import conf
-CRYPTOPP_DIR=['/usr','/usr/local','/opt/local','/sw']
-CRYPTOPP_VERSION_FILE='config.h'
-CRYPTOPP_VERSION_CODE='''
-#include <iostream>
-#include <cryptopp/config.h>
-int main() { std::cout << CRYPTOPP_VERSION; }
-'''
-
-def options(opt):
- opt.add_option('--cryptopp',type='string',default='',dest='cryptopp_dir',help='''path to where cryptopp is installed, e.g. /opt/local''')
-@conf
-def __cryptopp_get_version_file(self,dir):
- try:
- return self.root.find_dir(dir).find_node('%s/%s' % ('include/cryptopp', CRYPTOPP_VERSION_FILE))
- except:
- return None
-@conf
-def cryptopp_get_version(self,dir):
- val=self.check_cxx(fragment=CRYPTOPP_VERSION_CODE,includes=['%s/%s' % (dir, 'include')], execute=True, define_ret = True, mandatory=True)
- return val
-@conf
-def cryptopp_get_root(self,*k,**kw):
- root=k and k[0]or kw.get('path',None)
- # Logs.pprint ('RED', ' %s' %root)
- if root and self.__cryptopp_get_version_file(root):
- return root
- for dir in CRYPTOPP_DIR:
- if self.__cryptopp_get_version_file(dir):
- return dir
- if root:
- self.fatal('CryptoPP not found in %s'%root)
- else:
- self.fatal('CryptoPP not found, please provide a --cryptopp argument (see help)')
-@conf
-def check_cryptopp(self,*k,**kw):
- if not self.env['CXX']:
- self.fatal('load a c++ compiler first, conf.load("compiler_cxx")')
-
- var=kw.get('uselib_store','CRYPTOPP')
- self.start_msg('Checking CRYPTOPP')
- root = self.cryptopp_get_root(*k,**kw)
- self.env.CRYPTOPP_VERSION=self.cryptopp_get_version(root)
-
- self.env['INCLUDES_%s'%var]= '%s/%s' % (root, "include")
- self.env['LIB_%s'%var] = "cryptopp"
- self.env['LIBPATH_%s'%var] = '%s/%s' % (root, "lib")
-
- self.end_msg(self.env.CRYPTOPP_VERSION)
- if Logs.verbose:
- Logs.pprint('CYAN',' CRYPTOPP include : %s'%self.env['INCLUDES_%s'%var])
- Logs.pprint('CYAN',' CRYPTOPP lib : %s'%self.env['LIB_%s'%var])
- Logs.pprint('CYAN',' CRYPTOPP libpath : %s'%self.env['LIBPATH_%s'%var])
-
diff --git a/.waf-tools/default-compiler-flags.py b/.waf-tools/default-compiler-flags.py
index 7a317b1..d3246e1 100644
--- a/.waf-tools/default-compiler-flags.py
+++ b/.waf-tools/default-compiler-flags.py
@@ -151,12 +151,12 @@
'-Wextra',
'-Werror',
'-Wcatch-value=2',
- # '-Wextra-semi', # prevent noisy output with Qt5
+ #'-Wextra-semi', # Qt5
'-Wnon-virtual-dtor',
'-Wno-error=deprecated-declarations', # Bug #3795
'-Wno-error=maybe-uninitialized', # Bug #1615
+ '-Wno-deprecated-copy', # Qt5
'-Wno-unused-parameter',
- '-Wno-error=deprecated-copy', # Qt5
]
flags['LINKFLAGS'] += ['-Wl,-O1']
return flags
@@ -169,8 +169,9 @@
'-Wall',
'-Wextra',
'-Wcatch-value=2',
- '-Wextra-semi',
+ #'-Wextra-semi', # Qt5
'-Wnon-virtual-dtor',
+ '-Wno-deprecated-copy', # Qt5
'-Wno-unused-parameter',
]
flags['LINKFLAGS'] += ['-Wl,-O1']
@@ -180,7 +181,7 @@
def getDebugFlags(self, conf):
flags = super(GccFlags, self).getDebugFlags(conf)
flags['CXXFLAGS'] += ['-fdiagnostics-color',
- '-Wredundant-tags',
+ #'-Wredundant-tags', # Qt5
]
if platform.machine() == 'armv7l' and self.getCompilerVersion(conf) >= (7, 1, 0):
flags['CXXFLAGS'] += ['-Wno-psabi'] # Bug #5106
@@ -189,7 +190,7 @@
def getOptimizedFlags(self, conf):
flags = super(GccFlags, self).getOptimizedFlags(conf)
flags['CXXFLAGS'] += ['-fdiagnostics-color',
- '-Wredundant-tags',
+ #'-Wredundant-tags', # Qt5
]
if platform.machine() == 'armv7l' and self.getCompilerVersion(conf) >= (7, 1, 0):
flags['CXXFLAGS'] += ['-Wno-psabi'] # Bug #5106
@@ -225,4 +226,4 @@
]
if self.getCompilerVersion(conf) < (6, 0, 0):
flags['CXXFLAGS'] += ['-Wno-missing-braces'] # Bug #4721
- return flags
\ No newline at end of file
+ return flags