Skip to content

Commit

Permalink
Handle the build type
Browse files Browse the repository at this point in the history
  • Loading branch information
daquexian committed May 22, 2019
1 parent eaeb3a4 commit 6d04b45
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tools/onnx2daq/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ def build_extension(self, ext):
os.makedirs(CMAKE_BUILD_DIR)

with cd(CMAKE_BUILD_DIR):
build_type = 'Release'
# configure
cmake_args = [
CMAKE,
Expand All @@ -112,7 +113,8 @@ def build_extension(self, ext):
if COVERAGE or DEBUG:
# in order to get accurate coverage information, the
# build needs to turn off optimizations
cmake_args.append('-DCMAKE_BUILD_TYPE=Debug')
build_type = 'Debug'
cmake_args.append('-DCMAKE_BUILD_TYPE={}'.format(build_type))
if WINDOWS:
cmake_args.extend([
# we need to link with libpython on windows, so
Expand All @@ -136,6 +138,7 @@ def build_extension(self, ext):

build_args = [CMAKE, '--build', os.curdir]
if WINDOWS:
build_args.extend(['--config', build_type])
build_args.extend(['--', '/maxcpucount:{}'.format(multiprocessing.cpu_count())])
else:
build_args.extend(['--', '-j', str(multiprocessing.cpu_count())])
Expand Down

0 comments on commit 6d04b45

Please sign in to comment.