Skip to content

Commit

Permalink
Merge pull request #7 from RyeMutt/boost-fixes
Browse files Browse the repository at this point in the history
Fix Boost.Filesystem deprecation and replace PCRE with Boost.Regex
  • Loading branch information
bennettgoble authored Apr 6, 2024
2 parents 7bf1c6f + d538675 commit ee65e0e
Show file tree
Hide file tree
Showing 14 changed files with 90 additions and 132 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ file(GLOB stddatabase_files ${CMAKE_CURRENT_SOURCE_DIR}/src/modules/STLDatabase/
file(GLOB stderrplugin_files ${CMAKE_CURRENT_SOURCE_DIR}/src/modules/stdErrPlugin/*.cpp)

set(COLLADA_BASE_SOURCES ${dae_files} ${libxmlplugin_files} ${stddatabase_files} ${stderrplugin_files})
set(COLLADA_LIBS minizip ${libpcrecpp_LIBRARIES} ${ZLIB_LIBRARIES} ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY})
set(COLLADA_COMPILE_FLAGS "${libpcrecpp_CFLAGS_OTHERS} ${EXTRA_COMPILE_FLAGS} ${Boost_CFLAGS} -DDOM_INCLUDE_LIBXML")
set(COLLADA_LIBS minizip ${ZLIB_LIBRARIES} ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY})
set(COLLADA_COMPILE_FLAGS "${EXTRA_COMPILE_FLAGS} ${Boost_CFLAGS} -DDOM_INCLUDE_LIBXML")

if( OPT_COLLADA15 )
add_subdirectory(src/1.5)
Expand Down
74 changes: 0 additions & 74 deletions autobuild.xml
Original file line number Diff line number Diff line change
Expand Up @@ -226,80 +226,6 @@
<key>version</key>
<string>3.0.2.3e9876e</string>
</map>
<key>pcre</key>
<map>
<key>copyright</key>
<string>Copyright (c) 1997-2014 University of Cambridge; Copyright(c) 2009-2014 Zoltan Herczeg; Copyright (c) 2007-2012, Google Inc.</string>
<key>description</key>
<string>PCRE Perl-compatible regular expression library</string>
<key>license</key>
<string>bsd</string>
<key>license_file</key>
<string>LICENSES/pcre-license.txt</string>
<key>name</key>
<string>pcre</string>
<key>platforms</key>
<map>
<key>darwin64</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>b372d37596474043a62568e569b0ce155192f484</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-pcre/releases/download/v8.35.979fd86/pcre-8.35.979fd86-darwin64-979fd86.tar.zst</string>
</map>
<key>name</key>
<string>darwin64</string>
</map>
<key>linux64</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>3a722c508a9278a49317e3f749f3256768f1c50b</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-pcre/releases/download/v8.35-3c0eb51/pcre-8.35.3c0eb51-linux64-3c0eb51.tar.zst</string>
</map>
<key>name</key>
<string>linux64</string>
</map>
<key>windows</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>5e93602abcd5130c21a6d554dc088390326e68e7</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-pcre/releases/download/v8.35.979fd86/pcre-8.35.979fd86-windows-979fd86.tar.zst</string>
</map>
<key>name</key>
<string>linux</string>
</map>
<key>windows64</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>166564afb60a7536a038fae80e2fc9a41d6dbccb</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-pcre/releases/download/v8.35.979fd86/pcre-8.35.979fd86-windows64-979fd86.tar.zst</string>
</map>
<key>name</key>
<string>windows64</string>
</map>
</map>
<key>version</key>
<string>8.35.3c0eb51</string>
</map>
<key>zlib-ng</key>
<map>
<key>canonical_repo</key>
Expand Down
10 changes: 1 addition & 9 deletions make/dom.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ src += $(wildcard src/$(colladaVersion)/dom/*.cpp)

includeOpts := -Istage/packages/include \
-Istage/packages/include/zlib-ng \
-Istage/packages/include/pcre \
-Istage/packages/include/libxml2 \
-Istage/packages/include/minizip-ng \
-Iinclude \
Expand Down Expand Up @@ -46,14 +45,6 @@ includeOpts += -Iexternal-libs/tinyxml/
libOpts += external-libs/tinyxml/lib/$(buildID)/libtinyxml.a
endif

# On Mac, Windows and PS3 we need to be told where to find pcre
ifeq ($(os),windows)
ccFlags += -DPCRE_STATIC
else
includeOpts += -Istage/packages/include/pcre
libOpts += $(addprefix stage/packages/lib/release/,libpcrecpp.a libpcre.a )
endif

# For mingw: add boost
ifneq ($(findstring $(os),linux mac),)
includeOpts += -Istage/packages/include
Expand All @@ -66,6 +57,7 @@ endif
# errors about missing libboost_[file]system-mt.a. Hence $(archsupport).
libOpts += stage/packages/lib/$(conf)/libboost_system-mt$(archsupport)$(debug_suffix).a
libOpts += stage/packages/lib/$(conf)/libboost_filesystem-mt$(archsupport)$(debug_suffix).a
libOpts += stage/packages/lib/$(conf)/libboost_regex-mt$(archsupport)$(debug_suffix).a
endif

# minizip
Expand Down
11 changes: 3 additions & 8 deletions make/domTest.mk
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ endif

includeOpts += -Istage/packages/include \
-Istage/packages/include/zlib-ng \
-Istage/packages/include/pcre \
-Istage/packages/include/libxml2 \
-Istage/packages/include/minizip-ng
libOpts += -Lstage/packages/lib/$(conf)/
Expand All @@ -47,11 +46,6 @@ includeOpts += -I$(installPrefix)/$(domFramework)/Headers
endif
dependentLibs += $(domName)

# PCRE defs
ifeq ($(os),ps3)
libOpts += $(addprefix external-libs/pcre/lib/$(os)/,libpcrecpp.a libpcre.a)
endif

# TinyXml defs
ifneq ($(findstring tinyxml,$(xmlparsers)),)
# Notify domTest.cpp if we're supposed to do TinyXml tests
Expand All @@ -62,16 +56,17 @@ endif
endif

# Boost defs
# Test programs use some deprecated interfaces...
ccFlags += -DBOOST_FILESYSTEM_DEPRECATED
ifeq ($(os),linux)
libOpts += -lboost_filesystem-mt$(archsupport)$(debugSuffix)
libOpts += -lboost_regex-mt$(archsupport)$(debugSuffix)
else ifeq ($(os),mac)
libOpts += -lboost_filesystem-mt$(archsupport)$(debugSuffix)
libOpts += -lboost_regex-mt$(archsupport)$(debugSuffix)
else
includeOpts += -Iexternal-libs/boost
libOpts += external-libs/boost/lib/$(buildID)/libboost_system$(archsupport).a
libOpts += external-libs/boost/lib/$(buildID)/libboost_filesystem$(archsupport).a
libOpts += external-libs/boost/lib/$(buildID)/libboost_regex$(archsupport).a
endif
ifeq ($(os),ps3)
# PS3 doesn't support C++ locales, so tell boost not to use them
Expand Down
6 changes: 3 additions & 3 deletions make/readme
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,12 @@ Linux Notes
-----------

The Linux build has been tested with Ubuntu Gutsy. You need to have libxml,
PCRE, and boost filesystem development files installed on your machine to build
the DOM. The Ubuntu packages are named libxml2-dev, libpcre3-dev, and
boost regex, and boost filesystem development files installed on your machine to build
the DOM. The Ubuntu packages are named libxml2-dev, libboost-regex-dev, and
libboost-filesystem-dev.

It should be easy to get the DOM building on other versions of Linux, but you'll
need to figure out what packages to install for libxml, PCRE, and boost filesystem.
need to figure out what packages to install for libxml, boost regex, and boost filesystem.


Windows Notes
Expand Down
22 changes: 13 additions & 9 deletions projects/vc142-1.4/dom-static.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..\include;..\..\include\1.4;..\..\stage\packages\include;..\..\stage\packages\include\libxml2;..\..\stage\packages\include\minizip-ng;..\..\stage\packages\include\pcre;..\..\stage\packages\include\zlib-ng;..\..\external-libs\tinyxml;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE;DOM_INCLUDE_LIBXML;PCRE_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\include;..\..\include\1.4;..\..\stage\packages\include;..\..\stage\packages\include\libxml2;..\..\stage\packages\include\minizip-ng;..\..\stage\packages\include\zlib-ng;..\..\external-libs\tinyxml;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE;DOM_INCLUDE_LIBXML;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
Expand All @@ -88,6 +88,7 @@
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>OldStyle</DebugInformationFormat>
<TreatWChar_tAsBuiltInType>false</TreatWChar_tAsBuiltInType>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Lib>
<OutputFile>$(OutDir)libcollada14dom23-sd.lib</OutputFile>
Expand All @@ -96,8 +97,8 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..\include;..\..\include\1.4;..\..\stage\packages\include;..\..\stage\packages\include\libxml2;..\..\stage\packages\include\minizip-ng;..\..\stage\packages\include\pcre;..\..\stage\packages\include\zlib-ng;..\..\external-libs\tinyxml;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE;DOM_INCLUDE_LIBXML;PCRE_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\include;..\..\include\1.4;..\..\stage\packages\include;..\..\stage\packages\include\libxml2;..\..\stage\packages\include\minizip-ng;..\..\stage\packages\include\zlib-ng;..\..\external-libs\tinyxml;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE;DOM_INCLUDE_LIBXML;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
Expand All @@ -107,6 +108,7 @@
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>OldStyle</DebugInformationFormat>
<TreatWChar_tAsBuiltInType>false</TreatWChar_tAsBuiltInType>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Lib>
<OutputFile>$(OutDir)libcollada14dom23-sd.lib</OutputFile>
Expand All @@ -115,15 +117,16 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WholeProgramOptimization>false</WholeProgramOptimization>
<AdditionalIncludeDirectories>..\..\include;..\..\include\1.4;..\..\stage\packages\include;..\..\stage\packages\include\libxml2;..\..\stage\packages\include\minizip-ng;..\..\stage\packages\include\pcre;..\..\stage\packages\include\zlib-ng;..\..\external-libs\tinyxml;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;DOM_INCLUDE_LIBXML;PCRE_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\include;..\..\include\1.4;..\..\stage\packages\include;..\..\stage\packages\include\libxml2;..\..\stage\packages\include\minizip-ng;..\..\stage\packages\include\zlib-ng;..\..\external-libs\tinyxml;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;DOM_INCLUDE_LIBXML;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<DisableLanguageExtensions>false</DisableLanguageExtensions>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>OldStyle</DebugInformationFormat>
<TreatWChar_tAsBuiltInType>false</TreatWChar_tAsBuiltInType>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Lib>
<OutputFile>$(OutDir)libcollada14dom23-s.lib</OutputFile>
Expand All @@ -134,15 +137,16 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WholeProgramOptimization>false</WholeProgramOptimization>
<AdditionalIncludeDirectories>..\..\include;..\..\include\1.4;..\..\stage\packages\include;..\..\stage\packages\include\libxml2;..\..\stage\packages\include\minizip-ng;..\..\stage\packages\include\pcre;..\..\stage\packages\include\zlib-ng;..\..\external-libs\tinyxml;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;DOM_INCLUDE_LIBXML;PCRE_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\include;..\..\include\1.4;..\..\stage\packages\include;..\..\stage\packages\include\libxml2;..\..\stage\packages\include\minizip-ng;..\..\stage\packages\include\zlib-ng;..\..\external-libs\tinyxml;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;DOM_INCLUDE_LIBXML;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<DisableLanguageExtensions>false</DisableLanguageExtensions>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>OldStyle</DebugInformationFormat>
<TreatWChar_tAsBuiltInType>false</TreatWChar_tAsBuiltInType>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Lib>
<OutputFile>$(OutDir)libcollada14dom23-s.lib</OutputFile>
Expand Down Expand Up @@ -577,4 +581,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>
Loading

0 comments on commit ee65e0e

Please sign in to comment.