Will the option "--address-model=32,64" build both 32 and 64 libraries or do you have to do two separate builds?
Doing:
b2 address-model=32,64
Or..
b2 address-model=32,64,32_64
Work and produces, depending on toolset and platform support, both 32 and 64 bit targets in the first case. And 32, 64, and 32+64 universal targets (most likely only on OSX using the darwin
toolset. And by "works" I mean that I just tried it with my Boost library on OSX with the darwin
toolset. Hence I suspect you have your syntax wrong, i.e. don't use "--name=values" as they are not options, but instead use "name=values" are the are requirement specifications.
The documentation states (emphasis mine):
"Explicitly request either 32-bit or 64-bit code generation."
Note that it doesn't say "one or more of" or "at least one of", it says either ... or, which implies XOR in my reading of it and your experience matches that.
The comma in the list of allowed values is just to separate the two items in the set of allowed values.
I ended up doing the following:
- Store the 32 lib/dll builds in a separate folder called /lib32
- Store the 64 lib/dll builds in a seaprate folder called /lib64
Both are preferably in a search path that boost is already checking, such as stage or the installation folder.
Then I added this block right after the search paths are assembled under the header ( the FindBoost.cmake file to edit is under share/cmake-3.1/Modules/ folder in your CMake installation folder )
Begin finding boost libraries
...
if(Boost_LIBRARY_DIR)
...
endif()
#generate 32 and 64 bit paths
if(WIN32)
if(CMAKE_CL_64)
#message("Finding BOOST on windows platform (64 bit)")
SET(BOOST_libdir_suffix_gen "64")
else()
#message("Finding BOOST on windows platform (32 bit)")
SET(BOOST_libdir_suffix_gen "32")
endif()
list(APPEND _boost_LIBRARY_SEARCH_DIRS_PLATFORMS "")
foreach(SEARCH_DIR_NOPLATFORM ${_boost_LIBRARY_SEARCH_DIRS})
list(APPEND _boost_LIBRARY_SEARCH_DIRS_PLATFORMS ${SEARCH_DIR_NOPLATFORM}${BOOST_libdir_suffix_gen})
endforeach()
foreach(SEARCH_DIR_PLATFORM ${_boost_LIBRARY_SEARCH_DIRS_PLATFORMS})
list (APPEND _boost_LIBRARY_SEARCH_DIRS ${SEARCH_DIR_PLATFORM})
endforeach()
else()
# no generation required (?)
endif()
It will re-append all existing lib directories to the boost search path for libraries, suffixed with a 64 or 32 bit extension tag. This selects the correct target libs for linking, and you can safely regenerate any other dependent cmake library (like CGAL) for a 32 or 64 target build without resetting the boost dependency path.
© 2022 - 2024 — McMap. All rights reserved.
architecture=x86
– Antipersonnel