From 840f1463e53f43b28b2131e4a32b0ecae34a579f Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Sun, 2 Sep 2018 09:35:09 +0200 Subject: [PATCH] Fix libxml2 directives on travis --- .travis.yml | 18 ++++++++++++++++-- src/ifcparse/parse_ifcxml.cpp | 4 ++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7a5129021a..f716f90cfa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,7 +29,7 @@ install: - sudo apt-get install -y liboce-ocaf-dev - sudo apt-get install -y liboce-visualization-dev - sudo apt-get install -y liboce-ocaf-lite-dev - + - sudo apt-get install -y libxml2-dev - sudo apt-get install -y libpcre3-dev script: @@ -50,7 +50,21 @@ script: - cd cmake - mkdir build - cd build - - cmake -DCOLLADA_SUPPORT=True -DOPENCOLLADA_INCLUDE_DIR=/usr/local/include/opencollada -DOPENCOLLADA_LIBRARY_DIR=/usr/local/lib/opencollada -DPCRE_LIBRARY_DIR=/usr/lib/x86_64-linux-gnu -DBUILD_IFCPYTHON=True -DUNICODE_SUPPORT=True -DOCC_LIBRARY_DIR=/usr/lib/x86_64-linux-gnu -DPYTHON_LIBRARY=/usr/lib/python2.7/config-x86_64-linux-gnu/libpython2.7.so -DPYTHON_INCLUDE_DIR=/usr/include/python2.7 -DPYTHON_EXECUTABLE=/usr/bin/python2.7 .. + - | + cmake \ + -DCOLLADA_SUPPORT=True \ + -DOPENCOLLADA_INCLUDE_DIR=/usr/local/include/opencollada \ + -DOPENCOLLADA_LIBRARY_DIR=/usr/local/lib/opencollada \ + -DPCRE_LIBRARY_DIR=/usr/lib/x86_64-linux-gnu \ + -DBUILD_IFCPYTHON=True \ + -DUNICODE_SUPPORT=True \ + -DOCC_LIBRARY_DIR=/usr/lib/x86_64-linux-gnu \ + -DPYTHON_LIBRARY=/usr/lib/python2.7/config-x86_64-linux-gnu/libpython2.7.so \ + -DPYTHON_INCLUDE_DIR=/usr/include/python2.7 \ + -DPYTHON_EXECUTABLE=/usr/bin/python2.7 \ + -DLIBXML2_INCLUDE_DIR=/usr/include/libxml2 \ + -DLIBXML2_LIBRARIES=/usr/lib/x86_64-linux-gnu/libxml2.a \ + .. - sudo make install - cd ../../test - /usr/bin/python2.7 tests.py diff --git a/src/ifcparse/parse_ifcxml.cpp b/src/ifcparse/parse_ifcxml.cpp index 7aee86bb29..6d51bd7959 100644 --- a/src/ifcparse/parse_ifcxml.cpp +++ b/src/ifcparse/parse_ifcxml.cpp @@ -234,7 +234,7 @@ static void end_element(void* user, const xmlChar* tag) { } } -static void characters(void* user, const xmlChar* ch, int len) { +static void process_characters(void* user, const xmlChar* ch, int len) { ifcxml_parse_state* state = (ifcxml_parse_state*)user; if (state->file == nullptr) { @@ -602,7 +602,7 @@ IFC_PARSE_API IfcParse::IfcFile* IfcParse::parse_ifcxml(const std::string& filen memset(&handler, 0, sizeof(xmlSAXHandler)); handler.startElement = start_element; handler.endElement = end_element; - handler.characters = characters; + handler.characters = process_characters; xmlSAXUserParseFile(&handler, &state, filename.c_str());