diff --git a/CMakeLists.txt b/CMakeLists.txt index 4e7efdafe..96653bacf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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") @@ -314,8 +314,11 @@ target_compile_options(pagmo PRIVATE "$<$:${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 @@ -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 diff --git a/benchmarks/CMakeLists.txt b/benchmarks/CMakeLists.txt index 248c2df30..b713b0ee5 100644 --- a/benchmarks/CMakeLists.txt +++ b/benchmarks/CMakeLists.txt @@ -8,7 +8,8 @@ function(ADD_PAGMO_BENCHMARK arg1) "$<$:${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) diff --git a/doc/sphinx/changelog.rst b/doc/sphinx/changelog.rst index c3e691485..f2f0bcd5c 100644 --- a/doc/sphinx/changelog.rst +++ b/doc/sphinx/changelog.rst @@ -3,6 +3,23 @@ Changelog ========= +2.16.1 (unreleased) +------------------- + +Changes +~~~~~~~ + +- pagmo now requires CMake >= 3.8 + (`#458 `__). + +Fix +~~~ + +- Various build system fixes/improvements + (`#459 `__, + `#458 `__, + `#457 `__). + 2.16.0 (2020-09-25) ------------------- diff --git a/doc/sphinx/quickstart.rst b/doc/sphinx/quickstart.rst index a514d2e8e..75f16237c 100644 --- a/doc/sphinx/quickstart.rst +++ b/doc/sphinx/quickstart.rst @@ -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 `__, +`config-file package `__, 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 @@ -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) diff --git a/src/algorithms/nlopt.cpp b/src/algorithms/nlopt.cpp index 8e1785d6f..db6ba1550 100644 --- a/src/algorithms/nlopt.cpp +++ b/src/algorithms/nlopt.cpp @@ -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 *); diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 8badec05f..483294e94 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -18,7 +18,8 @@ function(ADD_PAGMO_TESTCASE arg1) "$<$:${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() diff --git a/tutorials/CMakeLists.txt b/tutorials/CMakeLists.txt index 6bd9f2700..932c4095a 100644 --- a/tutorials/CMakeLists.txt +++ b/tutorials/CMakeLists.txt @@ -8,7 +8,8 @@ function(ADD_PAGMO_TUTORIAL arg1) "$<$:${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()