Explorar o código

Merge branch 'master' into int64support

Lee Thomason %!s(int64=9) %!d(string=hai) anos
pai
achega
536a4cde37
Modificáronse 4 ficheiros con 20 adicións e 10 borrados
  1. 9 1
      CMakeLists.txt
  2. 4 4
      Makefile
  3. 1 1
      readme.md
  4. 6 4
      tinyxml2.cpp

+ 9 - 1
CMakeLists.txt

@@ -22,7 +22,7 @@ set(GENERIC_LIB_SOVERSION "3")
 
 
 ################################
-# Add common source 
+# Add common source
 
 include_directories("${CMAKE_CURRENT_SOURCE_DIR}/.")
 
@@ -72,6 +72,10 @@ set_target_properties(tinyxml2 PROPERTIES
 	VERSION "${GENERIC_LIB_VERSION}"
 	SOVERSION "${GENERIC_LIB_SOVERSION}")
 
+if(DEFINED CMAKE_VERSION AND NOT "${CMAKE_VERSION}" VERSION_LESS "2.8.11")
+    target_include_directories(tinyxml2 INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/.")
+endif()
+
 install(TARGETS tinyxml2
         RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
         LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
@@ -86,6 +90,10 @@ set_target_properties(tinyxml2_static PROPERTIES
         SOVERSION "${GENERIC_LIB_SOVERSION}")
 set_target_properties( tinyxml2_static PROPERTIES OUTPUT_NAME tinyxml2 )
 
+if(DEFINED CMAKE_VERSION AND NOT "${CMAKE_VERSION}" VERSION_LESS "2.8.11")
+    target_include_directories(tinyxml2_static INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/.")
+endif()
+
 install(TARGETS tinyxml2_static
         RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
         LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}

+ 4 - 4
Makefile

@@ -2,17 +2,17 @@ all: xmltest staticlib
 
 rebuild: clean all
 
-xmltest: xmltest.cpp tinyxml2.a
+xmltest: xmltest.cpp libtinyxml2.a
 
 clean:
-	$(RM) *.o xmltest tinyxml2.a
+	$(RM) *.o xmltest libtinyxml2.a
 	
 test: clean xmltest
 	./xmltest
 
-staticlib: tinyxml2.a
+staticlib: libtinyxml2.a
 
-tinyxml2.a: tinyxml2.o
+libtinyxml2.a: tinyxml2.o
 	$(AR) $(ARFLAGS)s $@ $^
 	
 tinyxml2.o: tinyxml2.cpp tinyxml2.h

+ 1 - 1
readme.md

@@ -264,7 +264,7 @@ There are 2 files in TinyXML-2:
 And additionally a test file:
 * xmltest.cpp
 
-Simply compile and run. There is a visual studio 2010 project included, a simple Makefile, 
+Simply compile and run. There is a visual studio 2015 project included, a simple Makefile, 
 an Xcode project, a Code::Blocks project, and a cmake CMakeLists.txt included to help you. 
 The top of tinyxml.h even has a simple g++ command line if you are are *nix and don't want 
 to use a build system.

+ 6 - 4
tinyxml2.cpp

@@ -1987,10 +1987,12 @@ struct LongFitsIntoSizeTMinusOne {
 };
 
 template <>
-bool LongFitsIntoSizeTMinusOne<false>::Fits( unsigned long /*value*/ )
-{
-    return true;
-}
+struct LongFitsIntoSizeTMinusOne<false> {
+    static bool Fits( unsigned long )
+    {
+        return true;
+    }
+};
 
 XMLError XMLDocument::LoadFile( FILE* fp )
 {