Skip to content

Conversation

@ClausKlein
Copy link

@ClausKlein ClausKlein commented Dec 1, 2025

use CMAKE_VERIFY_INTERFACE_HEADER_SETS if possible

This fix #34 too

Comment on lines +15 to +16
// FIXME(CK): #include <boost/type_index.hpp>
import boost.type_index;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@codeowners any reason to not use import?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#include <boost/type_index.hpp> automatically preprocesses to import boost.type_index; if the module is available


cmake_minimum_required( VERSION 3.5...3.31 )
project( boost_any VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX )
cmake_minimum_required(VERSION 3.21...4.2)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@codeowners what is the minimum version that must be supported?

import std; is usable starting with cmake v3.30 AFAIK

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we want to bump the minimum version so much. These CMake files are invoked from the Boost superproject, so bumping a minimum version in one affects every other library. I think 3.8 is okay.

Copy link
Author

@ClausKlein ClausKlein Dec 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on every build host cmake v4.2 may be installed with pipx install cmake?

I want to have PROJECT_IS_TOP_LEVEL available with cmake version 3.21 anything older is not state of the art!


cmake_minimum_required( VERSION 3.5...3.31 )
project( boost_any VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX )
cmake_minimum_required(VERSION 3.21...4.2)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we want to bump the minimum version so much. These CMake files are invoked from the Boost superproject, so bumping a minimum version in one affects every other library. I think 3.8 is okay.

CMakeLists.txt Outdated
add_executable(module_sample modules/usage_sample.cpp)
target_link_libraries(module_sample PRIVATE boost_any)
else()
set(CMAKE_VERIFY_INTERFACE_HEADER_SETS ON)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CMake docs suggest to not set this directly in code (https://cmake.org/cmake/help/latest/variable/CMAKE_VERIFY_INTERFACE_HEADER_SETS.html)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed it so it is only usable for standalone builds

CMakeLists.txt Outdated
endif()
set(__scope PUBLIC)

add_executable(module_sample modules/usage_sample.cpp)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't build examples from top-level cmakes

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@ClausKlein ClausKlein marked this pull request as draft December 4, 2025 16:14
@ClausKlein ClausKlein requested a review from anarthal December 4, 2025 16:15
@apolukhin
Copy link
Member

Fails with error:

 CMake Error at /home/runner/work/any/boost-root/libs/any/CMakeLists.txt:25 (if):
  if given arguments:

    "IN_LIST" "CMAKE_CXX_COMPILER_IMPORT_STD"

  Unknown arguments specified

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test if import std; is possible is wrong implemented

3 participants