Skip to content

Commit

Permalink
Feature/bump to boost v1.80.0 (Orphis#5)
Browse files Browse the repository at this point in the history
* prevent deprectated warnings on OSX

* bump to boost v1.80.0

* upgrade ubuntu CI build version

* add needed patches

* add date_time patch to be reverted

* add locale lib again

* change CI strategy

* fix Invalid workflow file

* define BOOST_NO_AUTO_PTR

* cleanup for nativ OSX

* prevent warnings on windows too
  • Loading branch information
ClausKlein committed Feb 19, 2023
1 parent 4fd3efd commit c147ef0
Show file tree
Hide file tree
Showing 9 changed files with 177 additions and 281 deletions.
48 changes: 37 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.21...3.24)

project(Boost-CMake LANGUAGES C CXX VERSION 1.79.0)
project(Boost-CMake LANGUAGES C CXX VERSION 1.80.0)

option(BOOST_DISABLE_TESTS "Do not build test targets, even if building standalone" OFF)

Expand All @@ -9,15 +9,15 @@ option(BOOST_DISABLE_TESTS "Do not build test targets, even if building standalo

include(cmake/CPM.cmake)

if(EXISTS "$ENV{CPM_SOURCE_CACHE}/boost_1_79_0")
set(FETCHCONTENT_SOURCE_DIR_BOOST "$ENV{CPM_SOURCE_CACHE}/boost_1_79_0" CACHE PATH "Boost source DIR")
if(EXISTS "$ENV{CPM_SOURCE_CACHE}/boost_1_80_0")
set(FETCHCONTENT_SOURCE_DIR_BOOST "$ENV{CPM_SOURCE_CACHE}/boost_1_80_0" CACHE PATH "Boost source DIR")
set(CPM_Boost_SOURCE ${FETCHCONTENT_SOURCE_DIR_BOOST} CACHE PATH "Manual override")
endif()

set(BOOST_URL "https://boostorg.jfrog.io/artifactory/main/release/1.79.0/source/boost_1_79_0.tar.bz2"
set(BOOST_URL "https://boostorg.jfrog.io/artifactory/main/release/1.80.0/source/boost_1_80_0.tar.bz2"
CACHE STRING "Boost download URL"
)
set(BOOST_URL_SHA256 "475d589d51a7f8b3ba2ba4eda022b170e562ca3b760ee922c146b6c65856ef39"
set(BOOST_URL_SHA256 "1e19565d82e43bc59209a168f5ac899d3ba471d55c7610c677d4ccf2c9c500c0"
CACHE STRING "Boost download URL SHA256 checksum"
)

Expand All @@ -30,6 +30,20 @@ if(NOT Boost_POPULATED)
FetchContent_Populate(Boost)
message(STATUS "Fetching Boost - done")
set(BOOST_SOURCE ${boost_SOURCE_DIR})
find_package(Patch)
if(Patch_FOUND)
message("Patch found: ${Patch_EXECUTABLE}")
message("Patching Boost")
execute_process(
COMMAND ${Patch_EXECUTABLE} -N -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/patches/${PROJECT_VERSION}/filesystem-01.patch
WORKING_DIRECTORY ${BOOST_SOURCE}/libs/filesystem COMMAND_ECHO STDOUT # XXX COMMAND_ERROR_IS_FATAL LAST
)
execute_process(
COMMAND ${Patch_EXECUTABLE} -R -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/patches/${PROJECT_VERSION}/date_time-02.patch
WORKING_DIRECTORY ${BOOST_SOURCE}/libs/date_time COMMAND_ECHO STDOUT # XXX COMMAND_ERROR_IS_FATAL LAST
)
message("Patching Boost - done")
endif()
endif()

list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules)
Expand Down Expand Up @@ -93,7 +107,7 @@ set(BOOST_LIBS_OPTIONAL
timer
type_erasure
wave
CACHE STRING "Boost libs to be compiled" FORCE
CACHE STRING "Boost libs to be compiled"
)

foreach(lib ${BOOST_LIBS_REQUIRED})
Expand Down Expand Up @@ -125,10 +139,17 @@ if(NOT PROJECT_IS_TOP_LEVEL)
target_link_libraries(boost INTERFACE Threads::Threads)
endif()

if(USE_APPLE)
# TODO(CK): too many deprectated warnings!
target_compile_definitions(boost INTERFACE BOOST_BIND_GLOBAL_PLACEHOLDERS)
target_compile_options(boost INTERFACE -Wno-deprecated-declarations)
target_compile_definitions(boost INTERFACE BOOST_BIND_GLOBAL_PLACEHOLDERS)

if(UNIX)
if(USE_APPLE)
# TODO(CK): too many deprectated warnings!
# intrusive/pointer_rebind.hpp:81:35: warning: 'rebind<std::pair<const int, int>>' is deprecated
# fiber/future/async.hpp:57 'result_of<void (*())()>' is deprecated
target_compile_options(boost INTERFACE -Wno-deprecated-declarations)
else()
target_compile_definitions(boost INTERFACE BOOST_NO_AUTO_PTR)
endif()
endif()

if(USE_ANDROID)
Expand Down Expand Up @@ -157,7 +178,12 @@ if(PROJECT_IS_TOP_LEVEL)
list(REMOVE_ITEM BOOST_LIBS mpi)
endif()

install(TARGETS ${BOOST_LIBS} Boost_locale_deps EXPORT boostTargets)
if(ICONV_FOUND)
install(TARGETS Boost_locale_deps EXPORT boostTargets)
else()
list(REMOVE_ITEM BOOST_LIBS locale)
endif()
install(TARGETS ${BOOST_LIBS} EXPORT boostTargets)
endif()

packageProject(
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ Redistribution and use in source and binary forms, with or without modification,

* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* Neither the name of the Phalcon nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
* Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL PHALCON FRAMEWORK TEAM BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ target_link_libraries(lib_using_header_only PUBLIC Boost::boost)

## Configuration

Boost will automatically be downloaded from https://boostorg.jfrog.io/artifactory/main/release/ !
Boost will automatically be downloaded from https://boostorg.jfrog.io/artifactory/main/release !

If that is not acceptable to you, you can use an alternate Boost version, apply
custom patches or just mirror the current archive in your internal network like so:
Expand Down
58 changes: 0 additions & 58 deletions azure-pipelines.yml

This file was deleted.

105 changes: 0 additions & 105 deletions build.sh

This file was deleted.

Loading

0 comments on commit c147ef0

Please sign in to comment.