Skip to content

Commit

Permalink
Merge pull request #459 from bluescarni/pr/iter
Browse files Browse the repository at this point in the history
Iterative improvements
  • Loading branch information
bluescarni authored Dec 19, 2020
2 parents e24fe93 + eb07b10 commit 7c7043f
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 10 deletions.
9 changes: 7 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ if(NOT CMAKE_BUILD_TYPE)
FORCE)
endif()

project(pagmo VERSION 2.16.0 LANGUAGES CXX C)
project(pagmo VERSION 2.16.1 LANGUAGES CXX C)

# Setup module path.
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules" "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/yacma")
Expand Down Expand Up @@ -314,8 +314,11 @@ target_compile_options(pagmo PRIVATE
"$<$<CONFIG:MinSizeRel>:${PAGMO_CXX_FLAGS_RELEASE}>"
)

# Set the minimum C++ standard to C++17
# Set the minimum C++ standard to C++17, both when building
# and consuming pagmo.
target_compile_features(pagmo PUBLIC cxx_std_17)
# Enforce vanilla C++17 when compiling pagmo.
set_property(TARGET pagmo PROPERTY CXX_EXTENSIONS NO)
# NOTE: make sure the include directories from the current build
# are included first, so that if there is already a pagmo installation
# in the prefix path we don't risk including the headers from that
Expand Down Expand Up @@ -345,6 +348,8 @@ target_link_libraries(pagmo PUBLIC Threads::Threads)

# Boost.
target_link_libraries(pagmo PUBLIC Boost::boost Boost::serialization)
# NOTE: quench warnings from Boost when building the library.
target_compile_definitions(pagmo PRIVATE BOOST_ALLOW_DEPRECATED_HEADERS)

# TBB.
# NOTE: TBB is a private dependency because
Expand Down
3 changes: 2 additions & 1 deletion benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ function(ADD_PAGMO_BENCHMARK arg1)
"$<$<CONFIG:MinSizeRel>:${PAGMO_CXX_FLAGS_RELEASE}>"
)
# Set the minimum C++ standard to C++17
target_compile_features(${arg1} PUBLIC cxx_std_17)
target_compile_features(${arg1} PRIVATE cxx_std_17)
set_property(TARGET ${arg1} PROPERTY CXX_EXTENSIONS NO)
endfunction()

ADD_PAGMO_BENCHMARK(thread_island_pool)
17 changes: 17 additions & 0 deletions doc/sphinx/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,23 @@
Changelog
=========

2.16.1 (unreleased)
-------------------

Changes
~~~~~~~

- pagmo now requires CMake >= 3.8
(`#458 <https://github.com/esa/pagmo2/pull/458>`__).

Fix
~~~

- Various build system fixes/improvements
(`#459 <https://github.com/esa/pagmo2/pull/459>`__,
`#458 <https://github.com/esa/pagmo2/pull/458>`__,
`#457 <https://github.com/esa/pagmo2/pull/457>`__).

2.16.0 (2020-09-25)
-------------------

Expand Down
5 changes: 1 addition & 4 deletions doc/sphinx/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Using pagmo with CMake
As a part of the pagmo installation, a group of CMake files is installed into
``CMAKE_INSTALL_PREFIX/lib/cmake/pagmo``.
This bundle, which is known in the CMake lingo as a
`config-file package <https://cmake.org/cmake/help/v3.3/manual/cmake-packages.7.html>`__,
`config-file package <https://cmake.org/cmake/help/latest/manual/cmake-packages.7.html>`__,
facilitates the detection and use of pagmo from other CMake-based projects.
pagmo's config-file package, once loaded, provides
an imported target called ``Pagmo::pagmo`` which encapsulates all the information
Expand All @@ -53,9 +53,6 @@ program presented earlier may look like this:

.. code-block:: cmake
# pagmo needs at least CMake 3.3.
cmake_minimum_required(VERSION 3.3)
# The name of our project.
project(sample_project)
Expand Down
2 changes: 1 addition & 1 deletion src/algorithms/nlopt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ extern "C" {
// Wrappers to connect our objfun/constraints calculation machinery to NLopt's. Declared here,
// defined later in order to avoid circular deps.
// NOTE: these functions need to be passed to the NLopt C API, and as such they need to be
// declated within an 'extern "C"' block (otherwise, it might be UB to pass C++ function pointers
// declared within an 'extern "C"' block (otherwise, it might be UB to pass C++ function pointers
// to a C API).
// https://www.reddit.com/r/cpp/comments/4fqfy7/using_c11_capturing_lambdas_w_vanilla_c_api/d2b9bh0/
double nlopt_objfun_wrapper(unsigned, const double *, double *, void *);
Expand Down
3 changes: 2 additions & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ function(ADD_PAGMO_TESTCASE arg1)
"$<$<CONFIG:MinSizeRel>:${PAGMO_CXX_FLAGS_RELEASE}>"
)
# Set the minimum C++ standard to C++17
target_compile_features(${arg1} PUBLIC cxx_std_17)
target_compile_features(${arg1} PRIVATE cxx_std_17)
set_property(TARGET ${arg1} PROPERTY CXX_EXTENSIONS NO)
add_test(${arg1} ${arg1})
endfunction()

Expand Down
3 changes: 2 additions & 1 deletion tutorials/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ function(ADD_PAGMO_TUTORIAL arg1)
"$<$<CONFIG:MinSizeRel>:${PAGMO_CXX_FLAGS_RELEASE}>"
)
# Set the minimum C++ standard to C++17
target_compile_features(${arg1} PUBLIC cxx_std_17)
target_compile_features(${arg1} PRIVATE cxx_std_17)
set_property(TARGET ${arg1} PROPERTY CXX_EXTENSIONS NO)
add_test(${arg1} ${arg1})
endfunction()

Expand Down

0 comments on commit 7c7043f

Please sign in to comment.