Commit e861f516 authored by Michael Turner's avatar Michael Turner
Browse files

Merge branch 'fix/tinyxml' into 'master'

fix/tinyxml

See merge request !820
parents fa7cfb9a f2aa151d
......@@ -12,6 +12,7 @@ v5.0.0
- Use chrono in Timer (!807)
- Fix caching of FUNCTION tags that read from file and provide the same
functionality in FUNCTIONs defined for forcings (!759)
- Add patch to tinyxml to fix size_t vs int bug (!820)
- Add ARPACK thirdparty build capabilities (!828)
- Added native support for csv files in addititon to pts (!760 !835)
- Utilize LAPACK_DIR env variable to find the native blas/lapack install (!827)
......
......@@ -20,30 +20,57 @@ ELSE()
SET(BUILD_TINYXML ON)
ENDIF ()
OPTION(THIRDPARTY_BUILD_TINYXML
OPTION(THIRDPARTY_BUILD_TINYXML
"Build TinyXML library from ThirdParty." ${BUILD_TINYXML})
IF (THIRDPARTY_BUILD_TINYXML)
INCLUDE(ExternalProject)
EXTERNALPROJECT_ADD(
tinyxml-2.6.2
PREFIX ${TPSRC}
URL ${TPURL}/tinyxml_2_6_2.tar.bz2
URL_MD5 240beaeb45f63b154c9801eef7561eac
STAMP_DIR ${TPBUILD}/stamp
DOWNLOAD_DIR ${TPSRC}
SOURCE_DIR ${TPSRC}/tinyxml-2.6.2
BINARY_DIR ${TPBUILD}/tinyxml-2.6.2
TMP_DIR ${TPBUILD}/tinyxml-2.6.2-tmp
INSTALL_DIR ${TPDIST}
CONFIGURE_COMMAND ${CMAKE_COMMAND}
-G ${CMAKE_GENERATOR}
-DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER}
-DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER}
-DCMAKE_INSTALL_PREFIX:PATH=${TPDIST}
-DCMAKE_CXX_FLAGS:STRING=-DTIXML_USE_STL
${TPSRC}/tinyxml-2.6.2
)
find_program(HAS_PATCH patch)
IF(HAS_PATCH)
EXTERNALPROJECT_ADD(
tinyxml-2.6.2
PREFIX ${TPSRC}
URL ${TPURL}/tinyxml_2_6_2.tar.bz2
URL_MD5 240beaeb45f63b154c9801eef7561eac
STAMP_DIR ${TPBUILD}/stamp
DOWNLOAD_DIR ${TPSRC}
SOURCE_DIR ${TPSRC}/tinyxml-2.6.2
BINARY_DIR ${TPBUILD}/tinyxml-2.6.2
TMP_DIR ${TPBUILD}/tinyxml-2.6.2-tmp
INSTALL_DIR ${TPDIST}
PATCH_COMMAND patch -d ${TPSRC}/tinyxml-2.6.2 < ${CMAKE_SOURCE_DIR}/cmake/scripts/tinyxml.patch
CONFIGURE_COMMAND ${CMAKE_COMMAND}
-G ${CMAKE_GENERATOR}
-DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER}
-DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER}
-DCMAKE_INSTALL_PREFIX:PATH=${TPDIST}
-DCMAKE_CXX_FLAGS:STRING=-DTIXML_USE_STL
${TPSRC}/tinyxml-2.6.2
)
ELSE()
MESSAGE(STATUS "patch utility not found, cannot apply patch to tinyxml, Nektar++ will still function")
EXTERNALPROJECT_ADD(
tinyxml-2.6.2
PREFIX ${TPSRC}
URL ${TPURL}/tinyxml_2_6_2.tar.bz2
URL_MD5 240beaeb45f63b154c9801eef7561eac
STAMP_DIR ${TPBUILD}/stamp
DOWNLOAD_DIR ${TPSRC}
SOURCE_DIR ${TPSRC}/tinyxml-2.6.2
BINARY_DIR ${TPBUILD}/tinyxml-2.6.2
TMP_DIR ${TPBUILD}/tinyxml-2.6.2-tmp
INSTALL_DIR ${TPDIST}
CONFIGURE_COMMAND ${CMAKE_COMMAND}
-G ${CMAKE_GENERATOR}
-DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER}
-DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER}
-DCMAKE_INSTALL_PREFIX:PATH=${TPDIST}
-DCMAKE_CXX_FLAGS:STRING=-DTIXML_USE_STL
${TPSRC}/tinyxml-2.6.2
)
ENDIF()
THIRDPARTY_LIBRARY(TINYXML_LIBRARY STATIC tinyxml
DESCRIPTION "TinyXML library")
......
--- tinyxmlparser.cpp 2017-10-03 16:05:35.999295200 +0100
+++ tinyxmlparser.cpp 2017-10-03 16:05:58.556565300 +0100
@@ -655,7 +655,7 @@
while ( in->good() )
{
- int tagIndex = (int) tag->length();
+ size_t tagIndex = tag->length();
while ( in->good() && in->peek() != '>' )
{
int c = in->get();
@@ -958,7 +958,7 @@
// We should be at a "<", regardless.
if ( !in->good() ) return;
assert( in->peek() == '<' );
- int tagIndex = (int) tag->length();
+ size_t tagIndex = tag->length();
bool closingTag = false;
bool firstCharFound = false;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment