From 5ba2aa995ccf08d41baf2e7686bcf1cff5998ff8 Mon Sep 17 00:00:00 2001 From: Thomas Fussell Date: Fri, 20 Nov 2015 23:34:39 -0500 Subject: [PATCH] add debug option to configure and fix travis --- .xlnt.supp | 16 ++++++++++++++++ cmake/CMakeLists.txt | 13 +++++++++++-- cmake/xlnt.test.cmake | 9 --------- configure | 2 ++ 4 files changed, 29 insertions(+), 11 deletions(-) create mode 100644 .xlnt.supp diff --git a/.xlnt.supp b/.xlnt.supp new file mode 100644 index 00000000..bf7c8860 --- /dev/null +++ b/.xlnt.supp @@ -0,0 +1,16 @@ +{ + miniz_cond_jump_uninitialized + Memcheck:Cond + fun:tdefl_compress_normal + fun:tdefl_compress + fun:tdefl_compress_buffer + fun:mz_zip_writer_add_mem_ex + fun:mz_zip_writer_add_mem + fun:_ZN4xlnt8zip_file8writestrERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_ + fun:_ZN4xlnt16excel_serializer10write_dataEb + fun:_ZN4xlnt16excel_serializer13save_workbookERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEb + fun:_ZN4xlnt8workbook4saveERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE + fun:_ZN10test_write25test_write_empty_workbookEv + fun:_ZN58TestDescription_suite_test_write_test_write_empty_workbook7runTestEv + fun:_ZN7CxxTest19RealTestDescription3runEv +} \ No newline at end of file diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 96f98999..c14d43b2 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -6,12 +6,21 @@ endif() project(xlnt) -option(SHARED "Set to ON to build shared libraries" OFF) +option(SHARED "Set to OFF to not build shared libraries" ON) +option(STATIC "Set to ON to build static libraries" OFF) +option(DEBUG "Set to ON to for debug configuration" OFF) option(BUILD_EXAMPLES "Build examples" OFF) option(BUILD_TESTS "Build tests runner" OFF) -option(AUTORUN_TESTS "Automatically run tests after building" OFF) option(COVERAGE "Create coverage files" OFF) +if(${CMAKE_GENERATOR} STREQUAL "Unix Makefiles") + if(DEBUG) + set(CMAKE_BUILD_TYPE "Debug") + else() + set(CMAKE_BUILD_TYPE "Release") + endif() +endif() + if(APPLE) set(CMAKE_OSX_DEPLOYMENT_TARGET 10.10) endif(APPLE) diff --git a/cmake/xlnt.test.cmake b/cmake/xlnt.test.cmake index 29a42963..f151ee91 100644 --- a/cmake/xlnt.test.cmake +++ b/cmake/xlnt.test.cmake @@ -64,12 +64,3 @@ add_custom_target (generate-test-runner ) add_dependencies(xlnt.test generate-test-runner) - -if(AUTORUN_TESTS) - add_custom_command( - TARGET xlnt.test - POST_BUILD - COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/../bin/xlnt.test - VERBATIM - ) -endif() diff --git a/configure b/configure index 659ef1b4..cdcfad39 100755 --- a/configure +++ b/configure @@ -93,6 +93,8 @@ def parse_args(args): options['BUILD_BENCHMARKS'] = 1 elif option.startswith('--prefix='): options['CMAKE_INSTALL_PREFIX'] = option.split('=')[1] + elif option == '--debug': + options['DEBUG'] = 1 else: print('skipping unknown option: {}'.format(option))