CMake build doesn't disable the Windows autolink feature
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 55/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- cmake, cpp
- Domain
- build-system
Research direction
Start in the process component's CMakeLists.txt and inspect the boost_process target_compile_definitions alongside the filesystem and url examples mentioned in the issue. Verify the Windows CMake build with the process v2 API no longer enables autolinking and no longer produces the reported missing-library link error.
Written by the indexing model from the issue text.
Description
When using the CMake build for the process component of Boost on Windows, the autolink feature is still active (using process v2 API), resulting in a link error:
LINK : fatal error LNK1104: cannot open file 'boost_process-vc143-mt-gd-x64-1_89.lib'
Using boost 1.89 release but I believe the problem is still present currently, i.e. autolink is active for CMake builds.
When comparing the CMakeLists.txt of Boost process with e.g. filesystem or url we don't have a BOOST_<COMPONENT>_NO_LIB define in Boost process:
url:
--8<--
function(boost_url_setup_properties target)
target_compile_features(${target} PUBLIC cxx_constexpr)
target_compile_definitions(${target} PUBLIC BOOST_URL_NO_LIB=1)
--8<--
filesystem:
--8<--
target_compile_definitions(boost_filesystem
PUBLIC
# NOTE:
# We deactivate autolinking, because cmake based builds don't need it
# and we don't implement name mangling for the library file anyway.
# Ususally the parent CMakeLists.txt file should already have globally defined BOOST_ALL_NO_LIB
BOOST_FILESYSTEM_NO_LIB
$<$<STREQUAL:$<TARGET_PROPERTY:boost_filesystem,TYPE>,SHARED_LIBRARY>:BOOST_FILESYSTEM_DYN_LINK=1>
$<$<STREQUAL:$<TARGET_PROPERTY:boost_filesystem,TYPE>,STATIC_LIBRARY>:BOOST_FILESYSTEM_STATIC_LINK=1>
PRIVATE
BOOST_FILESYSTEM_SOURCE
)
--8<--
Changing in process' CMakeLists.txt from...
--8<--
target_compile_definitions(boost_process
PRIVATE BOOST_PROCESS_SOURCE=1
)
--8<--
to...
--8<--
target_compile_definitions(boost_process
PUBLIC BOOST_PROCESS_NO_LIB
PRIVATE BOOST_PROCESS_SOURCE=1
)
--8<--
...solves the problem as it disables the autolink features.
- Dominant language
- C++
- Stars
- 145
- Forks
- 151
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from boostorg/process
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
All issues in boostorg/process
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
games-on-whales/wolf#509 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
bug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
NVIDIA/cuda-samples#453 ·