[openssl] Fix VS2017-only uwp builds. Use JOM for multithreading.

This commit is contained in:
Robert Schumacher 2017-06-08 02:15:58 -07:00
parent f29c2a3892
commit a73514fd77
4 changed files with 39 additions and 9 deletions

View File

@ -1,3 +1,3 @@
Source: openssl
Version: 1.0.2k-4
Version: 1.0.2k-5
Description: OpenSSL is an open source project that provides a robust, commercial-grade, and full-featured toolkit for the Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols. It is also a general-purpose cryptography library.

View File

@ -1,10 +1,20 @@
set build=%1
perl Configure no-asm no-hw no-dso VC-WINUNIVERSAL
perl Configure no-asm no-hw no-dso VC-WINUNIVERSAL -FS -FIWindows.h
set LibPath=%LibPath%;%WindowsSdkDir%References\%WindowsSDKLibVersion%Windows.Foundation.FoundationContract\3.0.0.0\
set LibPath=%LibPath%;%WindowsSdkDir%References\%WindowsSDKLibVersion%Windows.Foundation.FoundationContract\2.0.0.0\
set LibPath=%LibPath%;%WindowsSdkDir%References\%WindowsSDKLibVersion%Windows.Foundation.FoundationContract\1.0.0.0\
set LibPath=%LibPath%;%WindowsSdkDir%References\%WindowsSDKLibVersion%Windows.Foundation.UniversalApiContract\4.0.0.0\
set LibPath=%LibPath%;%WindowsSdkDir%References\%WindowsSDKLibVersion%Windows.Foundation.UniversalApiContract\3.0.0.0\
set LibPath=%LibPath%;%WindowsSdkDir%References\%WindowsSDKLibVersion%Windows.Foundation.UniversalApiContract\2.0.0.0\
set LibPath=%LibPath%;%WindowsSdkDir%References\%WindowsSDKLibVersion%Windows.Foundation.UniversalApiContract\1.0.0.0\
call ms\do_winuniversal.bat
call ms\setVSvars.bat universal10.0%build%
mkdir inc32\openssl
jom -j %NUMBER_OF_PROCESSORS% -k -f ms\ntdll.mak
REM due to a race condition in the build, we need to have a second single-threaded pass.
nmake -f ms\ntdll.mak

View File

@ -7,7 +7,8 @@
#
if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
message(FATAL_ERROR "Static building not supported yet")
set(VCPKG_LIBRARY_LINKAGE dynamic)
message("Static building not supported yet")
endif()
if (NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
@ -29,8 +30,10 @@ include(vcpkg_common_functions)
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/openssl-OpenSSL_1_0_2k_WinRT)
vcpkg_find_acquire_program(PERL)
vcpkg_find_acquire_program(JOM)
get_filename_component(JOM_EXE_PATH ${JOM} DIRECTORY)
get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY)
set(ENV{PATH} "$ENV{PATH};${PERL_EXE_PATH}")
set(ENV{PATH} "$ENV{PATH};${PERL_EXE_PATH};${JOM_EXE_PATH}")
vcpkg_download_distfile(ARCHIVE
URLS "https://github.com/Microsoft/openssl/archive/OpenSSL_1_0_2k_WinRT.zip"

View File

@ -13,6 +13,7 @@ find_program(NMAKE nmake)
get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY)
get_filename_component(NASM_EXE_PATH ${NASM} DIRECTORY)
vcpkg_find_acquire_program(JOM)
set(ENV{PATH} "${PERL_EXE_PATH};${NASM_EXE_PATH};$ENV{PATH}")
vcpkg_download_distfile(OPENSSL_SOURCE_ARCHIVE
@ -60,7 +61,7 @@ set(SOURCE_PATH_RELEASE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/openssl-
set(OPENSSLDIR_RELEASE ${CURRENT_PACKAGES_DIR})
vcpkg_execute_required_process(
COMMAND ${CONFIGURE_COMMAND} ${OPENSSL_ARCH} "--prefix=${OPENSSLDIR_RELEASE}" "--openssldir=${OPENSSLDIR_RELEASE}"
COMMAND ${CONFIGURE_COMMAND} ${OPENSSL_ARCH} "--prefix=${OPENSSLDIR_RELEASE}" "--openssldir=${OPENSSLDIR_RELEASE}" -FS
WORKING_DIRECTORY ${SOURCE_PATH_RELEASE}
LOGNAME configure-perl-${TARGET_TRIPLET}-${CMAKE_BUILD_TYPE}-rel
)
@ -69,10 +70,19 @@ vcpkg_execute_required_process(
WORKING_DIRECTORY ${SOURCE_PATH_RELEASE}
LOGNAME configure-do-${TARGET_TRIPLET}-${CMAKE_BUILD_TYPE}-rel
)
# Openssl's buildsystem has a race condition which will cause JOM to fail at some point.
# This is ok; we just do as much work as we can in parallel first, then follow up with a single-threaded build.
make_directory(${SOURCE_PATH_RELEASE}/inc32/openssl)
execute_process(
COMMAND ${JOM} -k -j $ENV{NUMBER_OF_PROCESSORS} -f ${OPENSSL_MAKEFILE}
WORKING_DIRECTORY ${SOURCE_PATH_RELEASE}
OUTPUT_FILE ${CURRENT_BUILDTREES_DIR}/build-${TARGET_TRIPLET}-rel-0-out.log
ERROR_FILE ${CURRENT_BUILDTREES_DIR}/build-${TARGET_TRIPLET}-rel-0-err.log
)
vcpkg_execute_required_process(
COMMAND ${NMAKE} -f ${OPENSSL_MAKEFILE} install
WORKING_DIRECTORY ${SOURCE_PATH_RELEASE}
LOGNAME build-${TARGET_TRIPLET}-rel)
LOGNAME build-${TARGET_TRIPLET}-rel-1)
message(STATUS "Build ${TARGET_TRIPLET}-rel done")
@ -83,7 +93,7 @@ set(SOURCE_PATH_DEBUG ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/openssl-${
set(OPENSSLDIR_DEBUG ${CURRENT_PACKAGES_DIR}/debug)
vcpkg_execute_required_process(
COMMAND ${CONFIGURE_COMMAND} debug-${OPENSSL_ARCH} "--prefix=${OPENSSLDIR_DEBUG}" "--openssldir=${OPENSSLDIR_DEBUG}"
COMMAND ${CONFIGURE_COMMAND} debug-${OPENSSL_ARCH} "--prefix=${OPENSSLDIR_DEBUG}" "--openssldir=${OPENSSLDIR_DEBUG}" -FS
WORKING_DIRECTORY ${SOURCE_PATH_DEBUG}
LOGNAME configure-perl-${TARGET_TRIPLET}-${CMAKE_BUILD_TYPE}-dbg
)
@ -92,10 +102,17 @@ vcpkg_execute_required_process(
WORKING_DIRECTORY ${SOURCE_PATH_DEBUG}
LOGNAME configure-do-${TARGET_TRIPLET}-${CMAKE_BUILD_TYPE}-dbg
)
make_directory(${SOURCE_PATH_DEBUG}/inc32/openssl)
execute_process(
COMMAND ${JOM} -k -j $ENV{NUMBER_OF_PROCESSORS} -f ${OPENSSL_MAKEFILE}
WORKING_DIRECTORY ${SOURCE_PATH_DEBUG}
OUTPUT_FILE ${CURRENT_BUILDTREES_DIR}/build-${TARGET_TRIPLET}-dbg-0-out.log
ERROR_FILE ${CURRENT_BUILDTREES_DIR}/build-${TARGET_TRIPLET}-dbg-0-err.log
)
vcpkg_execute_required_process(
COMMAND ${NMAKE} -f ${OPENSSL_MAKEFILE} install
WORKING_DIRECTORY ${SOURCE_PATH_DEBUG}
LOGNAME build-${TARGET_TRIPLET}-dbg)
LOGNAME build-${TARGET_TRIPLET}-dbg-1)
message(STATUS "Build ${TARGET_TRIPLET}-dbg done")