[boost-modular-build-helper] Fix multiple compiler and linker options… (#7160)

* [boost-modular-build-helper] Fix multiple compiler and linker options support in boost
This commit is contained in:
Igor Kostenko 2019-08-20 01:06:57 +01:00 committed by Phil Christensen
parent 5a1e992023
commit 7656eb0317

View File

@ -149,8 +149,8 @@ function(boost_modular_build)
--ignore-site-config --ignore-site-config
--hash --hash
-q -q
-sZLIB_INCLUDE="${CURRENT_INSTALLED_DIR}/include" "-sZLIB_INCLUDE=${CURRENT_INSTALLED_DIR}/include"
-sBZIP2_INCLUDE="${CURRENT_INSTALLED_DIR}/include" "-sBZIP2_INCLUDE=${CURRENT_INSTALLED_DIR}/include"
threading=multi threading=multi
) )
if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
@ -160,55 +160,55 @@ function(boost_modular_build)
endif() endif()
set(_bm_OPTIONS_DBG set(_bm_OPTIONS_DBG
-sZLIB_BINARY=zlibd -sZLIB_BINARY=zlibd
-sZLIB_LIBPATH="${CURRENT_INSTALLED_DIR}/debug/lib" "-sZLIB_LIBPATH=${CURRENT_INSTALLED_DIR}/debug/lib"
-sBZIP2_BINARY=bz2d -sBZIP2_BINARY=bz2d
-sBZIP2_LIBPATH="${CURRENT_INSTALLED_DIR}/debug/lib" "-sBZIP2_LIBPATH=${CURRENT_INSTALLED_DIR}/debug/lib"
) )
set(_bm_OPTIONS_REL set(_bm_OPTIONS_REL
-sZLIB_BINARY=zlib -sZLIB_BINARY=zlib
-sZLIB_LIBPATH="${CURRENT_INSTALLED_DIR}/lib" "-sZLIB_LIBPATH=${CURRENT_INSTALLED_DIR}/lib"
-sBZIP2_BINARY=bz2 -sBZIP2_BINARY=bz2
-sBZIP2_LIBPATH="${CURRENT_INSTALLED_DIR}/lib" "-sBZIP2_LIBPATH=${CURRENT_INSTALLED_DIR}/lib"
) )
# Properly handle compiler and linker flags passed by VCPKG # Properly handle compiler and linker flags passed by VCPKG
if(VCPKG_CXX_FLAGS) if(VCPKG_CXX_FLAGS)
list(APPEND _bm_OPTIONS cxxflags="${VCPKG_CXX_FLAGS}") list(APPEND _bm_OPTIONS "cxxflags=${VCPKG_CXX_FLAGS}")
endif() endif()
if(VCPKG_CXX_FLAGS_RELEASE) if(VCPKG_CXX_FLAGS_RELEASE)
list(APPEND _bm_OPTIONS_REL cxxflags="${VCPKG_CXX_FLAGS_RELEASE}") list(APPEND _bm_OPTIONS_REL "cxxflags=${VCPKG_CXX_FLAGS_RELEASE}")
endif() endif()
if(VCPKG_CXX_FLAGS_DEBUG) if(VCPKG_CXX_FLAGS_DEBUG)
list(APPEND _bm_OPTIONS_DBG cxxflags="${VCPKG_CXX_FLAGS_DEBUG}") list(APPEND _bm_OPTIONS_DBG "cxxflags=${VCPKG_CXX_FLAGS_DEBUG}")
endif() endif()
if(VCPKG_C_FLAGS) if(VCPKG_C_FLAGS)
list(APPEND _bm_OPTIONS cflags="${VCPKG_C_FLAGS}") list(APPEND _bm_OPTIONS "cflags=${VCPKG_C_FLAGS}")
endif() endif()
if(VCPKG_C_FLAGS_RELEASE) if(VCPKG_C_FLAGS_RELEASE)
list(APPEND _bm_OPTIONS_REL cflags="${VCPKG_C_FLAGS_RELEASE}") list(APPEND _bm_OPTIONS_REL "cflags=${VCPKG_C_FLAGS_RELEASE}")
endif() endif()
if(VCPKG_C_FLAGS_DEBUG) if(VCPKG_C_FLAGS_DEBUG)
list(APPEND _bm_OPTIONS_DBG cflags="${VCPKG_C_FLAGS_DEBUG}") list(APPEND _bm_OPTIONS_DBG "cflags=${VCPKG_C_FLAGS_DEBUG}")
endif() endif()
if(VCPKG_LINKER_FLAGS) if(VCPKG_LINKER_FLAGS)
list(APPEND _bm_OPTIONS linkflags="${VCPKG_LINKER_FLAGS}") list(APPEND _bm_OPTIONS "linkflags=${VCPKG_LINKER_FLAGS}")
endif() endif()
if(VCPKG_LINKER_FLAGS_RELEASE) if(VCPKG_LINKER_FLAGS_RELEASE)
list(APPEND _bm_OPTIONS_REL linkflags="${VCPKG_LINKER_FLAGS_RELEASE}") list(APPEND _bm_OPTIONS_REL "linkflags=${VCPKG_LINKER_FLAGS_RELEASE}")
endif() endif()
if(VCPKG_LINKER_FLAGS_DEBUG) if(VCPKG_LINKER_FLAGS_DEBUG)
list(APPEND _bm_OPTIONS_DBG linkflags="${VCPKG_LINKER_FLAGS_DEBUG}") list(APPEND _bm_OPTIONS_DBG "linkflags=${VCPKG_LINKER_FLAGS_DEBUG}")
endif() endif()
@ -251,9 +251,9 @@ function(boost_modular_build)
endif() endif()
endif() endif()
file(TO_NATIVE_PATH "${PLATFORM_WINMD_DIR}" PLATFORM_WINMD_DIR) file(TO_NATIVE_PATH "${PLATFORM_WINMD_DIR}" PLATFORM_WINMD_DIR)
string(REPLACE "\\" "\\\\" PLATFORM_WINMD_DIR ${PLATFORM_WINMD_DIR}) # escape backslashes string(REPLACE "\\" "/" PLATFORM_WINMD_DIR ${PLATFORM_WINMD_DIR}) # escape backslashes
set(TOOLSET_OPTIONS "${TOOLSET_OPTIONS} <cflags>-Zl <compileflags>\"/AI\"${PLATFORM_WINMD_DIR}\"\" <linkflags>WindowsApp.lib <cxxflags>/ZW <compileflags>-DVirtualAlloc=VirtualAllocFromApp <compileflags>-D_WIN32_WINNT=0x0A00") set(TOOLSET_OPTIONS "${TOOLSET_OPTIONS} <cflags>-Zl <compileflags>\"/AI${PLATFORM_WINMD_DIR}\" <linkflags>WindowsApp.lib <cxxflags>/ZW <compileflags>-DVirtualAlloc=VirtualAllocFromApp <compileflags>-D_WIN32_WINNT=0x0A00")
else() else()
set(TOOLSET_OPTIONS "${TOOLSET_OPTIONS} <compileflags>-D_WIN32_WINNT=0x0602") set(TOOLSET_OPTIONS "${TOOLSET_OPTIONS} <compileflags>-D_WIN32_WINNT=0x0602")
endif() endif()