File tree Expand file tree Collapse file tree 1 file changed +22
-2
lines changed Expand file tree Collapse file tree 1 file changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -105,10 +105,30 @@ function(boost_lib_installer req_boost_version req_boost_libs)
105105 set (debug_lib_path "${install_dir} /${stage_dir} /lib/libboost_${lib_name} -${compiler_name} -mt-gd-${lib_postfix} .lib" )
106106 set (lib_path "${install_dir} /${stage_dir} /lib/libboost_${lib_name} -${compiler_name} -mt-${lib_postfix} .lib" )
107107 else ()
108+ set (LIBSUFFIX "" )
109+ if (UNIX )
110+ if (CMAKE_SIZEOF_VOID_P EQUAL 8)
111+ set (LIBSUFFIX "-x64" )
112+ endif ()
113+ endif ()
114+
115+ if (APPLE )
116+ # Extract first letter after architecture= (e.g., 'a' from 'architecture=arm')
117+ string (REGEX MATCH "architecture=([a-zA-Z])" _ "${b2Args} " )
118+ set (ARCHITECTURE_PREFIX "${CMAKE_MATCH_1} " )
119+
120+ # Extract address model number (e.g., 32_64 from address-model=32_64)
121+ string (REGEX MATCH "address-model=([0-9_]+)" _ "${b2Args} " )
122+ set (ADDRESS_MODEL "${CMAKE_MATCH_1} " )
123+
124+ # Build lib suffix like -x64 or -a32
125+ set (LIBSUFFIX "-${ARCHITECTURE_PREFIX}${ADDRESS_MODEL} " )
126+ endif ()
127+
108128 if ((CMAKE_BUILD_TYPE STREQUAL "Debug" ) OR (CMAKE_BUILD_TYPE STREQUAL "" ) OR (NOT DEFINED CMAKE_BUILD_TYPE ))
109- set (lib_path "${install_dir} /${stage_dir} /lib/libboost_${lib_name} -mt-d.a" )
129+ set (lib_path "${install_dir} /${stage_dir} /lib/libboost_${lib_name} -mt-d${LIBSUFFIX} .a" )
110130 else ()
111- set (lib_path "${install_dir} /${stage_dir} /lib/libboost_${lib_name} -mt.a" )
131+ set (lib_path "${install_dir} /${stage_dir} /lib/libboost_${lib_name} -mt${LIBSUFFIX} .a" )
112132 endif ()
113133 endif ()
114134
You can’t perform that action at this time.
0 commit comments