Merge remote-tracking branch 'refs/remotes/origin/master'

This commit is contained in:
flysha 2017-01-25 10:01:57 +08:00
commit 033c7d0af6
35 changed files with 660 additions and 598 deletions

View File

@ -1,3 +1,24 @@
vcpkg (0.0.70)
--------------
* Add ports:
- fltk 1.3.4-1
- glib 2.50.2
- lzo 2.09
- uvatlas sept2016
* Update ports:
- dx 1.0.0 -> 1.0.1
- libmysql 5.7.16 -> 5.7.17
* Add support for Visual Studio 2017
- Previously, you could use Visual Studio 2017 for your own application and `vcpkg` integration would work, but you needed to have Visual Studio 2015 to build `vcpkg` itself as well as the libraries. This requirement has now been removed
- If both Visual Studio 2015 and Visual Studio 2017 are installed, Visual Studio 2017 tools will be preferred over those of Visual Studio 2015
* Bump required version & auto-downloaded version of `cmake` to 3.7.2 (was 3.5.x), which includes generators for Visual Studio 2017
* Bump auto-downloaded version of `nuget` to 3.5.0 (was 3.4.3)
* Bump auto-downloaded version of `git` to 2.11.0 (was 2.8.3)
* Fixes and improvements in existing portfiles and the `vcpkg` tool itself
-- vcpkg team <vcpkg@microsoft.com> MON, 23 Jan 2017 19:50:00 -0800
vcpkg (0.0.67)
--------------
* Add ports:

View File

@ -1,378 +0,0 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 44842d3..e89eed9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -118,7 +118,7 @@ IF(DEFINED MYSQL_PROJECT_NAME)
SET(MYSQL_PROJECT_NAME ${MYSQL_PROJECT_NAME} CACHE STRING
${MYSQL_PROJECT_NAME_DOCSTRING} FORCE)
ELSE()
- SET(MYSQL_PROJECT_NAME "MySQL" CACHE STRING
+ SET(MYSQL_PROJECT_NAME "LibMySQL" CACHE STRING
${MYSQL_PROJECT_NAME_DOCSTRING} FORCE)
MARK_AS_ADVANCED(MYSQL_PROJECT_NAME)
ENDIF()
@@ -132,6 +132,9 @@ IF(CMAKE_BUILD_TYPE MATCHES "Debug" OR WITH_DEBUG)
ENDIF()
ENDIF()
+OPTION(FORCE_UNSUPPORTED_COMPILER "Disable compiler version checks" ON)
+MARK_AS_ADVANCED(FORCE_UNSUPPORTED_COMPILER)
+
OPTION(WITH_DEFAULT_COMPILER_OPTIONS
"Use flags from cmake/build_configurations/compiler_options.cmake"
ON)
@@ -193,46 +196,30 @@ ENDIF()
INCLUDE(character_sets)
INCLUDE(cpu_info)
INCLUDE(zlib)
-INCLUDE(lz4)
-INCLUDE(libevent)
INCLUDE(ssl)
-INCLUDE(readline)
-INCLUDE(protobuf)
INCLUDE(mysql_version)
INCLUDE(libutils)
INCLUDE(dtrace)
-INCLUDE(plugin)
INCLUDE(install_macros)
INCLUDE(install_layout)
INCLUDE(mysql_add_executable)
# Handle options
-IF(EXISTS ${CMAKE_SOURCE_DIR}/rapid)
- OPTION(WITH_RAPID
- "Build additonal code(plugins) that is located in rapid directory" ON)
-ELSE()
- OPTION(WITH_RAPID
- "Build additonal code(plugins) that is located in rapid directory" OFF)
-ENDIF()
OPTION(DISABLE_SHARED
"Don't build shared libraries, compile code as position-dependent" OFF)
+MARK_AS_ADVANCED(DISABLE_SHARED)
IF(DISABLE_SHARED)
SET(WITHOUT_DYNAMIC_PLUGINS 1)
ENDIF()
OPTION(ENABLED_PROFILING "Enable profiling" ON)
-OPTION(WITHOUT_SERVER OFF)
+SET(WITHOUT_SERVER ON)
IF(UNIX)
OPTION(WITH_VALGRIND "Valgrind instrumentation" OFF)
ENDIF()
IF(WIN32)
OPTION(WITH_MSCRT_DEBUG "MS Visual Studio Debug CRT instrumentation" OFF)
ENDIF()
-IF(NOT WITHOUT_SERVER)
- OPTION (WITH_UNIT_TESTS "Compile MySQL with unit tests" ON)
-ENDIF()
-OPTION(FORCE_UNSUPPORTED_COMPILER "Disable compiler version checks" OFF)
-MARK_AS_ADVANCED(WITHOUT_SERVER DISABLE_SHARED FORCE_UNSUPPORTED_COMPILER)
-
+OPTION (WITH_UNIT_TESTS "Compile MySQL with unit tests" OFF)
include(CheckCSourceCompiles)
include(CheckCXXSourceCompiles)
@@ -452,18 +439,8 @@ ELSE()
SET(DEFAULT_TMPDIR "\"${TMPDIR}\"")
ENDIF()
-INCLUDE(cmake/boost.cmake)
-
-IF (CMAKE_SYSTEM_NAME MATCHES "Linux")
- OPTION(WITH_SYSTEMD "Enable installation of systemd support files" OFF)
- IF (WITH_SYSTEMD)
- INCLUDE(cmake/systemd.cmake)
- ENDIF()
-ELSE()
- IF (WITH_SYSTEMD)
- MESSAGE(FATAL_ERROR "Installation of systemd support files not supported")
- ENDIF()
-ENDIF()
+# Boost is not needed to build libmysql (yet)
+#INCLUDE(cmake/boost.cmake)
# Run platform tests
INCLUDE(configure.cmake)
@@ -479,76 +456,6 @@ INCLUDE_DIRECTORIES(
MYSQL_CHECK_ZLIB_WITH_COMPRESS()
# Add bundled yassl/taocrypt or system openssl.
MYSQL_CHECK_SSL()
-# Add system/bundled editline.
-MYSQL_CHECK_EDITLINE()
-# Add libevent
-MYSQL_CHECK_LIBEVENT()
-# Add lz4 library
-MYSQL_CHECK_LZ4()
-# Add protoc and libprotobuf
-IF(NOT WITHOUT_SERVER)
- MYSQL_CHECK_PROTOBUF()
-ENDIF()
-
-# Check for SYS_thread_selfid system call
-CHECK_C_SOURCE_COMPILES("
-#include <sys/types.h>
-#include <sys/syscall.h>
-#include <unistd.h>
-int main(int ac, char **av)
-{
- unsigned long long tid = syscall(SYS_thread_selfid);
- return (tid != 0 ? 0 : 1);
-}"
-HAVE_SYS_THREAD_SELFID)
-
-# Check for gettid() system call
-CHECK_C_SOURCE_COMPILES("
-#include <sys/types.h>
-#include <sys/syscall.h>
-#include <unistd.h>
-int main(int ac, char **av)
-{
- unsigned long long tid = syscall(SYS_gettid);
- return (tid != 0 ? 0 : 1);
-}"
-HAVE_SYS_GETTID)
-
-IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
- # Check for pthread_setname_np
- CHECK_C_SOURCE_COMPILES("
- #include <pthread.h>
- int main(int ac, char **av)
- {
- const char *thread_name= 0;
- int ret = pthread_setname_np(pthread_self(), thread_name);
- return ret;
- }"
- HAVE_PTHREAD_SETNAME_NP)
-ENDIF()
-
-# Check for pthread_getthreadid_np()
-CHECK_C_SOURCE_COMPILES("
-#include <pthread_np.h>
-int main(int ac, char **av)
-{
- unsigned long long tid = pthread_getthreadid_np();
- return (tid != 0 ? 0 : 1);
-}"
-HAVE_PTHREAD_GETTHREADID_NP)
-
-# Check for pthread_self() returning an integer type
-CHECK_C_SOURCE_COMPILES("
-#include <sys/types.h>
-#include <pthread.h>
-int main(int ac, char **av)
-{
- unsigned long long tid = pthread_self();
- return (tid != 0 ? 0 : 1);
-}"
-HAVE_INTEGER_PTHREAD_SELF
-FAIL_REGEX "warning: incompatible pointer to integer conversion"
-)
#
# Setup maintainer mode options by the end. Platform checks are
@@ -563,18 +470,15 @@ OPTION(MYSQL_MAINTAINER_MODE
INCLUDE(maintainer)
-IF(WITH_UNIT_TESTS)
+IF(0) #WITH_UNIT_TESTS)
ENABLE_TESTING()
ENDIF()
-IF(NOT WITHOUT_SERVER)
+IF(0) #NOT WITHOUT_SERVER)
SET (MYSQLD_STATIC_PLUGIN_LIBS "" CACHE INTERNAL "")
SET (MYSQLD_STATIC_EMBEDDED_PLUGIN_LIBS "" CACHE INTERNAL "")
# Add storage engines and plugins.
CONFIGURE_PLUGINS()
-ELSE()
- # We may still want Cluster client libraries, use -DWITH_NDBCLUSTER=1
- ADD_SUBDIRECTORY(storage/ndb)
ENDIF()
ADD_SUBDIRECTORY(include)
@@ -588,61 +492,18 @@ ADD_SUBDIRECTORY(libmysql)
ADD_SUBDIRECTORY(libbinlogevents)
ADD_SUBDIRECTORY(libbinlogstandalone)
-IF(WITH_UNIT_TESTS)
- # Visual Studio 11 needs this extra flag in order to compile gmock.
- IF(WIN32)
- ADD_DEFINITIONS( /D _VARIADIC_MAX=10 )
- ENDIF()
- # libc++ doesn't have tuple in tr1
- IF(HAVE_LLVM_LIBCPP)
- ADD_DEFINITIONS(-DGTEST_USE_OWN_TR1_TUPLE=1)
- ENDIF()
- ADD_SUBDIRECTORY(unittest)
- ADD_SUBDIRECTORY(unittest/examples)
- ADD_SUBDIRECTORY(unittest/mytap)
- ADD_SUBDIRECTORY(unittest/mytap/t)
- IF(WITH_RAPID AND EXISTS ${CMAKE_SOURCE_DIR}/rapid/unittest/gunit)
- ADD_SUBDIRECTORY(rapid/unittest/gunit)
- ENDIF()
-ENDIF()
+SET(WITH_INNOBASE_STORAGE_ENGINE 0)
ADD_SUBDIRECTORY(extra)
-ADD_SUBDIRECTORY(client)
ADD_SUBDIRECTORY(sql/share)
-ADD_SUBDIRECTORY(libservices)
-
-IF(UNIX)
- ADD_SUBDIRECTORY(man)
-ENDIF()
-
-IF(NOT WITHOUT_SERVER)
- ADD_SUBDIRECTORY(testclients)
- ADD_SUBDIRECTORY(sql)
- OPTION (WITH_EMBEDDED_SERVER "Compile MySQL with embedded server" OFF)
- IF(WITH_EMBEDDED_SERVER)
- ADD_SUBDIRECTORY(libmysqld)
- ADD_SUBDIRECTORY(libmysqld/examples)
- ENDIF(WITH_EMBEDDED_SERVER)
-ENDIF()
-
-# scripts/mysql_config depends on client and server targets loaded above.
-# It is referenced by some of the directories below, so we insert it here.
ADD_SUBDIRECTORY(scripts)
+ADD_SUBDIRECTORY(support-files)
-IF(NOT WITHOUT_SERVER)
- ADD_SUBDIRECTORY(mysql-test)
- ADD_SUBDIRECTORY(mysql-test/lib/My/SafeProcess)
- ADD_SUBDIRECTORY(support-files)
- IF(EXISTS ${CMAKE_SOURCE_DIR}/internal/CMakeLists.txt)
- ADD_SUBDIRECTORY(internal)
- ENDIF()
- ADD_SUBDIRECTORY(packaging/rpm-oel)
- ADD_SUBDIRECTORY(packaging/rpm-fedora)
- ADD_SUBDIRECTORY(packaging/rpm-sles)
- ADD_SUBDIRECTORY(packaging/rpm-docker)
- ADD_SUBDIRECTORY(packaging/deb-in)
-ENDIF()
+#
+# Directory where error message database is generated (GenError target)
+#
+FILE(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/sql/share)
INCLUDE(cmake/abi_check.cmake)
INCLUDE(cmake/tags.cmake)
@@ -680,11 +541,7 @@ ELSE()
SET(CPACK_GENERATOR "TGZ")
ENDIF()
ADD_SUBDIRECTORY(packaging/WiX)
-ADD_SUBDIRECTORY(packaging/solaris)
-IF(UNIX)
- INSTALL(FILES Docs/mysql.info DESTINATION ${INSTALL_INFODIR} OPTIONAL COMPONENT Info)
-ENDIF()
#
# RPM installs documentation directly from the source tree
#
diff --git a/extra/CMakeLists.txt b/extra/CMakeLists.txt
index 3adf988..9e0ba30 100644
--- a/extra/CMakeLists.txt
+++ b/extra/CMakeLists.txt
@@ -70,87 +70,4 @@ ADD_DEFINITIONS(-DMUTEX_EVENT)
COPY_OPENSSL_DLLS(copy_openssl_extra)
IF (WIN32 AND WITH_SSL_PATH AND HAVE_CRYPTO_DLL)
ADD_DEPENDENCIES(GenError copy_openssl_extra)
-ENDIF()
-
-
-MYSQL_ADD_EXECUTABLE(my_print_defaults my_print_defaults.c)
-TARGET_LINK_LIBRARIES(my_print_defaults mysys mysys_ssl)
-SET_TARGET_PROPERTIES(my_print_defaults PROPERTIES LINKER_LANGUAGE CXX)
-
-MYSQL_ADD_EXECUTABLE(perror perror.c)
-ADD_DEPENDENCIES(perror GenError)
-TARGET_LINK_LIBRARIES(perror mysys mysys_ssl)
-SET_TARGET_PROPERTIES(perror PROPERTIES LINKER_LANGUAGE CXX)
-
-MYSQL_ADD_EXECUTABLE(resolveip resolveip.c)
-TARGET_LINK_LIBRARIES(resolveip mysys mysys_ssl)
-SET_TARGET_PROPERTIES(resolveip PROPERTIES LINKER_LANGUAGE CXX)
-IF(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
- INCLUDE(CheckFunctionExists)
- INCLUDE(CheckLibraryExists)
- MY_SEARCH_LIBS(inet_aton "nsl;socket;resolv" SOLARIS_NSL)
- TARGET_LINK_LIBRARIES(resolveip ${SOLARIS_NSL})
-ENDIF()
-
-
-MYSQL_ADD_EXECUTABLE(replace replace.c)
-TARGET_LINK_LIBRARIES(replace mysys)
-
-MYSQL_ADD_EXECUTABLE(lz4_decompress lz4_decompress.cc)
-TARGET_LINK_LIBRARIES(lz4_decompress ${LZ4_LIBRARY})
-
-MYSQL_ADD_EXECUTABLE(zlib_decompress zlib_decompress.cc)
-TARGET_LINK_LIBRARIES(zlib_decompress ${ZLIB_LIBRARY})
-
-IF(WITH_INNOBASE_STORAGE_ENGINE)
-
- IF(LZ4_INCLUDE_DIR AND LZ4_LIBRARY)
- ADD_DEFINITIONS(-DHAVE_LZ4=1)
- INCLUDE_DIRECTORIES(${LZ4_INCLUDE_DIR})
- ENDIF()
-
- # Add path to the InnoDB headers
- INCLUDE_DIRECTORIES(
- ${CMAKE_SOURCE_DIR}/storage/innobase/include
- ${CMAKE_SOURCE_DIR}/sql
- )
- # We use the InnoDB code directly in case the code changes.
- ADD_DEFINITIONS("-DUNIV_INNOCHECKSUM")
- SET(INNOBASE_SOURCES
- ../storage/innobase/buf/buf0checksum.cc
- ../storage/innobase/ut/ut0crc32.cc
- ../storage/innobase/ut/ut0ut.cc
- ../storage/innobase/buf/buf0buf.cc
- ../storage/innobase/page/page0zip.cc
- ../storage/innobase/os/os0file.cc
- )
-
- # Avoid generating Hardware Capabilities due to crc32 instructions
- IF(CMAKE_SYSTEM_NAME MATCHES "SunOS" AND
- CMAKE_SYSTEM_PROCESSOR MATCHES "i386")
- INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/compile_flags.cmake)
- MY_CHECK_CXX_COMPILER_FLAG("-Wa,-nH" HAVE_WA_NH)
- IF(HAVE_WA_NH)
- ADD_COMPILE_FLAGS(
- ../storage/innobase/ut/ut0crc32.cc
- COMPILE_FLAGS "-Wa,-nH"
- )
- ENDIF()
- ENDIF()
-
- MYSQL_ADD_EXECUTABLE(innochecksum innochecksum.cc ${INNOBASE_SOURCES})
- TARGET_LINK_LIBRARIES(innochecksum mysys mysys_ssl ${LZ4_LIBRARY})
- ADD_DEPENDENCIES(innochecksum GenError)
-ENDIF()
-
-IF(UNIX)
- MYSQL_ADD_EXECUTABLE(resolve_stack_dump resolve_stack_dump.cc)
- TARGET_LINK_LIBRARIES(resolve_stack_dump mysys mysys_ssl)
-ENDIF()
-
-# In published release builds on Solaris, we need to bundle gcc source.
-# PB2 will take care of putting it in extra/ when needed
-IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/gcc-4.8.1.tar.bz2)
- INSTALL(FILES gcc-4.8.1.tar.bz2
- DESTINATION ${INSTALL_MYSQLSHAREDIR} COMPONENT Development)
-ENDIF()
+ENDIF()
\ No newline at end of file
diff --git a/mysys/mysys_priv.h b/mysys/mysys_priv.h
index 8b7a554..4353037 100644
--- a/mysys/mysys_priv.h
+++ b/mysys/mysys_priv.h
@@ -18,6 +18,7 @@
#include "my_global.h"
#include "mysql/psi/mysql_thread.h"
+#include "my_sys.h"
#ifdef HAVE_PSI_INTERFACE

View File

@ -1,3 +1,3 @@
Source: libmysql
Version: 5.7.16
Source: libmysql
Version: 5.7.17
Description: A MySQL client library for C development.

View File

@ -0,0 +1,44 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 44842d3..e34ab24 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -452,7 +452,7 @@ ELSE()
SET(DEFAULT_TMPDIR "\"${TMPDIR}\"")
ENDIF()
-INCLUDE(cmake/boost.cmake)
+#INCLUDE(cmake/boost.cmake)
IF (CMAKE_SYSTEM_NAME MATCHES "Linux")
OPTION(WITH_SYSTEMD "Enable installation of systemd support files" OFF)
diff --git a/client/dump/CMakeLists.txt b/client/dump/CMakeLists.txt
index bae2ce7..4e11516 100644
--- a/client/dump/CMakeLists.txt
+++ b/client/dump/CMakeLists.txt
@@ -21,12 +21,12 @@ INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/dump
)
-IF (CMAKE_CXX_COMPILER_ID STREQUAL "SunPro")
+#IF (CMAKE_CXX_COMPILER_ID STREQUAL "SunPro")
IF (WITHOUT_SERVER)
MESSAGE(STATUS "Not building mysqlpump")
RETURN()
ENDIF()
-ENDIF()
+#ENDIF()
# Prevent Boost from including external precompiled Boost libraries, use
# threading (not implemented for older Solaris Studio compilers)
diff --git a/mysys/mysys_priv.h b/mysys/mysys_priv.h
index 8b7a554..4353037 100644
--- a/mysys/mysys_priv.h
+++ b/mysys/mysys_priv.h
@@ -18,6 +18,7 @@
#include "my_global.h"
#include "mysql/psi/mysql_thread.h"
+#include "my_sys.h"
#ifdef HAVE_PSI_INTERFACE

View File

@ -1,70 +1,82 @@
if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
message(STATUS "Warning: Static building not supported yet. Building dynamic.")
set(VCPKG_LIBRARY_LINKAGE dynamic)
endif()
include(vcpkg_common_functions)
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mysql-server-mysql-5.7.16)
if (EXISTS "${CURRENT_INSTALLED_DIR}/include/mysql.h")
message(FATAL_ERROR "FATAL ERROR: libmysql and libmariadb are incompatible.")
endif()
vcpkg_download_distfile(ARCHIVE
URLS "https://github.com/mysql/mysql-server/archive/mysql-5.7.16.tar.gz"
FILENAME "mysql-server-mysql-5.7.16.tar.gz"
SHA512 30a3c55ebb15f18ededf814b66c108f18b2ced9c39e08319cdc9559ccf38d494ad9322098f2b04418ddf557e46d9d727be0e514be0ae982ac4f5186aa295b9c6
)
vcpkg_extract_source_archive(${ARCHIVE})
vcpkg_apply_patches(
SOURCE_PATH ${SOURCE_PATH}
PATCHES
${CMAKE_CURRENT_LIST_DIR}/0001_cmake.patch
)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
)
vcpkg_install_cmake()
# delete debug headers
file(REMOVE_RECURSE
${CURRENT_PACKAGES_DIR}/debug/include)
# delete useless vcruntime/scripts/bin/msg file
file(REMOVE_RECURSE
${CURRENT_PACKAGES_DIR}/share
${CURRENT_PACKAGES_DIR}/debug/share
${CURRENT_PACKAGES_DIR}/bin
${CURRENT_PACKAGES_DIR}/debug/bin
${CURRENT_PACKAGES_DIR}/lib/debug)
file(MAKE_DIRECTORY
${CURRENT_PACKAGES_DIR}/share
${CURRENT_PACKAGES_DIR}/bin
${CURRENT_PACKAGES_DIR}/debug/bin)
# remove misc files
file(REMOVE
${CURRENT_PACKAGES_DIR}/COPYING
${CURRENT_PACKAGES_DIR}/my-default.ini
${CURRENT_PACKAGES_DIR}/README
${CURRENT_PACKAGES_DIR}/debug/COPYING
${CURRENT_PACKAGES_DIR}/debug/my-default.ini
${CURRENT_PACKAGES_DIR}/debug/README)
# remove mysqlclient.lib
file(REMOVE
${CURRENT_PACKAGES_DIR}/lib/mysqlclient.lib
${CURRENT_PACKAGES_DIR}/debug/lib/mysqlclient.lib)
# correct the dll directory
file (RENAME ${CURRENT_PACKAGES_DIR}/lib/libmysql.dll ${CURRENT_PACKAGES_DIR}/bin/libmysql.dll)
file (RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/libmysql.dll ${CURRENT_PACKAGES_DIR}/debug/bin/libmysql.dll)
file (RENAME ${CURRENT_PACKAGES_DIR}/lib/libmysql.pdb ${CURRENT_PACKAGES_DIR}/bin/libmysql.pdb)
file (RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/libmysql.pdb ${CURRENT_PACKAGES_DIR}/debug/bin/libmysql.pdb)
# copy license
file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libmysql)
include(vcpkg_common_functions)
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mysql-server-mysql-5.7.17)
vcpkg_download_distfile(ARCHIVE
URLS "https://github.com/mysql/mysql-server/archive/mysql-5.7.17.tar.gz"
FILENAME "mysql-server-mysql-5.7.17.tar.gz"
SHA512 511027f28f0705f59a08ec369b1ebe5d9a77eb839d545898631f1ebbcb6b4b800f5b88511d3ae5d231c04e09a2d7b2b2d178264d36aeb2bc602cc1b0b248cfba
)
vcpkg_extract_source_archive(${ARCHIVE})
vcpkg_apply_patches(
SOURCE_PATH ${SOURCE_PATH}
PATCHES
${CMAKE_CURRENT_LIST_DIR}/boost_and_build.patch
)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
OPTIONS
-DWITHOUT_SERVER=ON
-DWITH_UNIT_TESTS=OFF
-DENABLED_PROFILING=OFF
)
vcpkg_install_cmake()
# delete debug headers
file(REMOVE_RECURSE
${CURRENT_PACKAGES_DIR}/debug/include)
# switch mysql into /mysql
file(RENAME ${CURRENT_PACKAGES_DIR}/include ${CURRENT_PACKAGES_DIR}/include2)
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/include)
file(RENAME ${CURRENT_PACKAGES_DIR}/include2 ${CURRENT_PACKAGES_DIR}/include/mysql)
## delete useless vcruntime/scripts/bin/msg file
file(REMOVE_RECURSE
${CURRENT_PACKAGES_DIR}/share
${CURRENT_PACKAGES_DIR}/debug/share
${CURRENT_PACKAGES_DIR}/bin
${CURRENT_PACKAGES_DIR}/debug/bin
${CURRENT_PACKAGES_DIR}/docs
${CURRENT_PACKAGES_DIR}/debug/docs
${CURRENT_PACKAGES_DIR}/lib/debug)
# remove misc files
file(REMOVE
${CURRENT_PACKAGES_DIR}/COPYING
${CURRENT_PACKAGES_DIR}/README
${CURRENT_PACKAGES_DIR}/debug/COPYING
${CURRENT_PACKAGES_DIR}/debug/README)
# remove not-related libs
file (REMOVE
${CURRENT_PACKAGES_DIR}/lib/mysqlservices.lib
${CURRENT_PACKAGES_DIR}/debug/lib/mysqlservices.lib)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(REMOVE
${CURRENT_PACKAGES_DIR}/lib/libmysql.lib
${CURRENT_PACKAGES_DIR}/lib/libmysql.dll
${CURRENT_PACKAGES_DIR}/lib/libmysql.pdb
${CURRENT_PACKAGES_DIR}/debug/lib/libmysql.lib
${CURRENT_PACKAGES_DIR}/debug/lib/libmysql.dll
${CURRENT_PACKAGES_DIR}/debug/lib/libmysql.pdb)
else()
file(REMOVE
${CURRENT_PACKAGES_DIR}/lib/mysqlclient.lib
${CURRENT_PACKAGES_DIR}/debug/lib/mysqlclient.lib)
# correct the dll directory
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin)
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/bin)
file (RENAME ${CURRENT_PACKAGES_DIR}/lib/libmysql.dll ${CURRENT_PACKAGES_DIR}/bin/libmysql.dll)
file (RENAME ${CURRENT_PACKAGES_DIR}/lib/libmysql.pdb ${CURRENT_PACKAGES_DIR}/bin/libmysql.pdb)
file (RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/libmysql.dll ${CURRENT_PACKAGES_DIR}/debug/bin/libmysql.dll)
file (RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/libmysql.pdb ${CURRENT_PACKAGES_DIR}/debug/bin/libmysql.pdb)
endif()
# copy license
file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libmysql)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/libmysql/COPYING ${CURRENT_PACKAGES_DIR}/share/libmysql/copyright)

3
ports/lzo/CONTROL Normal file
View File

@ -0,0 +1,3 @@
Source: lzo
Version: 2.09
Description: Lossless data compression library

View File

@ -0,0 +1,17 @@
diff --git a/src/lzo_supp.h b/src/lzo_supp.h
index 87307f9..f94a6b0 100644
--- a/src/lzo_supp.h
+++ b/src/lzo_supp.h
@@ -3643,9 +3643,9 @@ LZO_EXTERN_C int __lzo_cdecl _setargv(void) { return __setargv(); }
#endif
#if (LZO_OS_WIN32 || LZO_OS_WIN64)
#if (LZO_CC_INTELC || LZO_CC_MSC)
-LZO_EXTERN_C int __lzo_cdecl __setargv(void);
-LZO_EXTERN_C int __lzo_cdecl _setargv(void);
-LZO_EXTERN_C int __lzo_cdecl _setargv(void) { return __setargv(); }
+// LZO_EXTERN_C int __lzo_cdecl __setargv(void);
+// LZO_EXTERN_C int __lzo_cdecl _setargv(void);
+// LZO_EXTERN_C int __lzo_cdecl _setargv(void) { return __setargv(); }
#endif
#endif
#if (LZO_OS_EMX)

44
ports/lzo/portfile.cmake Normal file
View File

@ -0,0 +1,44 @@
# Common Ambient Variables:
# VCPKG_ROOT_DIR = <C:\path\to\current\vcpkg>
# TARGET_TRIPLET is the current triplet (x86-windows, etc)
# PORT is the current port name (zlib, etc)
# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT}
# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET}
#
if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
message(STATUS "Warning: Dynamic building not supported yet. Building static.")
set(VCPKG_LIBRARY_LINKAGE static)
endif()
include(vcpkg_common_functions)
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/lzo-2.09)
vcpkg_download_distfile(ARCHIVE
URLS "http://www.oberhumer.com/opensource/lzo/download/lzo-2.09.tar.gz"
FILENAME "lzo-2.09.tar.gz"
SHA512 7c64e5e7d2050d75ac8c59d613f6f7230b74746b1d207666755b07450053c8b73980f12f8a1ec59d2af0bada02beec126aaacb675b8088b5fe65e97ff7e6bfc7
)
vcpkg_extract_source_archive(${ARCHIVE})
vcpkg_apply_patches(
SOURCE_PATH ${SOURCE_PATH}
PATCHES "${CMAKE_CURRENT_LIST_DIR}/do-not-declare-setargv.patch"
)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
# OPTIONS -DUSE_THIS_IN_ALL_BUILDS=1 -DUSE_THIS_TOO=2
# OPTIONS_RELEASE -DOPTIMIZE=1
# OPTIONS_DEBUG -DDEBUGGABLE=1
)
vcpkg_install_cmake()
vcpkg_copy_pdbs()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
# Handle copyright
file(COPY ${CURRENT_BUILDTREES_DIR}/src/lzo-2.09/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/lzo)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/lzo/COPYING ${CURRENT_PACKAGES_DIR}/share/lzo/copyright)

View File

@ -1,3 +1,3 @@
Source: mpir
Version: 2.7.2
Source: mpir
Version: 2.7.2-1
Description: Multiple Precision Integers and Rationals.

View File

@ -1,53 +1,73 @@
if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
message(STATUS "Warning: Static building not supported yet. Building dynamic.")
set(VCPKG_LIBRARY_LINKAGE dynamic)
endif()
include(vcpkg_common_functions)
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mpir-2.7.2)
vcpkg_download_distfile(ARCHIVE_FILE
URLS "http://mpir.org/mpir-2.7.2.tar.lz"
FILENAME "mpir-2.7.2.tar.lz"
SHA512 2635c167ddbba99364ec741373768e0675d34f94fad8912d5433b95e6fbfdb0510f5e94a707acc42048254bc658c52c6671bb0c0dac31267c4b82b00c3e74efa
)
vcpkg_extract_source_archive(${ARCHIVE_FILE})
vcpkg_build_msbuild(
PROJECT_PATH ${SOURCE_PATH}/build.vc14/dll_mpir_gc/dll_mpir_gc.vcxproj
)
IF (TRIPLET_SYSTEM_ARCH MATCHES "x86")
SET(BUILD_ARCH "Win32")
ELSE()
SET(BUILD_ARCH ${TRIPLET_SYSTEM_ARCH})
ENDIF()
file(INSTALL
${SOURCE_PATH}/dll/${BUILD_ARCH}/Debug/gmp.h
${SOURCE_PATH}/dll/${BUILD_ARCH}/Debug/gmpxx.h
${SOURCE_PATH}/dll/${BUILD_ARCH}/Debug/mpir.h
${SOURCE_PATH}/dll/${BUILD_ARCH}/Debug/mpirxx.h
DESTINATION ${CURRENT_PACKAGES_DIR}/include
)
file(INSTALL
${SOURCE_PATH}/dll/${BUILD_ARCH}/Debug/mpir.dll
${SOURCE_PATH}/dll/${BUILD_ARCH}/Debug/mpir.pdb
DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin
)
file(INSTALL
${SOURCE_PATH}/dll/${BUILD_ARCH}/Release/mpir.dll
${SOURCE_PATH}/dll/${BUILD_ARCH}/Release/mpir.pdb
DESTINATION ${CURRENT_PACKAGES_DIR}/bin
)
file(INSTALL
${SOURCE_PATH}/dll/${BUILD_ARCH}/Debug/mpir.lib
DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib
)
file(INSTALL
${SOURCE_PATH}/dll/${BUILD_ARCH}/Release/mpir.lib
DESTINATION ${CURRENT_PACKAGES_DIR}/lib
)
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/mpir RENAME copyright)
vcpkg_copy_pdbs()
message(STATUS "Installing done")
include(vcpkg_common_functions)
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mpir-2.7.2)
vcpkg_download_distfile(ARCHIVE_FILE
URLS "http://mpir.org/mpir-2.7.2.tar.bz2"
FILENAME "mpir-2.7.2.tar.bz2"
SHA512 8436a0123201f9e30130ea340331c5a6445dddb58ce1f6c6a3a8303c310ac5b3c279c83b5c520a757cba82c2b14e92da44583e0eec287090cf69cbb29d516a9c
)
vcpkg_extract_source_archive(${ARCHIVE_FILE})
if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
vcpkg_build_msbuild(
PROJECT_PATH ${SOURCE_PATH}/build.vc14/dll_mpir_gc/dll_mpir_gc.vcxproj
)
else()
vcpkg_build_msbuild(
PROJECT_PATH ${SOURCE_PATH}/build.vc14/lib_mpir_gc/lib_mpir_gc.vcxproj
)
endif()
IF (TRIPLET_SYSTEM_ARCH MATCHES "x86")
SET(BUILD_ARCH "Win32")
ELSE()
SET(BUILD_ARCH ${TRIPLET_SYSTEM_ARCH})
ENDIF()
if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
file(INSTALL
${SOURCE_PATH}/dll/${BUILD_ARCH}/Debug/gmp.h
${SOURCE_PATH}/dll/${BUILD_ARCH}/Debug/gmpxx.h
${SOURCE_PATH}/dll/${BUILD_ARCH}/Debug/mpir.h
${SOURCE_PATH}/dll/${BUILD_ARCH}/Debug/mpirxx.h
DESTINATION ${CURRENT_PACKAGES_DIR}/include
)
file(INSTALL
${SOURCE_PATH}/dll/${BUILD_ARCH}/Debug/mpir.dll
${SOURCE_PATH}/dll/${BUILD_ARCH}/Debug/mpir.pdb
DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin
)
file(INSTALL
${SOURCE_PATH}/dll/${BUILD_ARCH}/Release/mpir.dll
${SOURCE_PATH}/dll/${BUILD_ARCH}/Release/mpir.pdb
DESTINATION ${CURRENT_PACKAGES_DIR}/bin
)
file(INSTALL
${SOURCE_PATH}/dll/${BUILD_ARCH}/Debug/mpir.lib
DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib
)
file(INSTALL
${SOURCE_PATH}/dll/${BUILD_ARCH}/Release/mpir.lib
DESTINATION ${CURRENT_PACKAGES_DIR}/lib
)
file(INSTALL ${SOURCE_PATH}/COPYING.lib DESTINATION ${CURRENT_PACKAGES_DIR}/share/mpir RENAME copyright)
vcpkg_copy_pdbs()
else()
file(INSTALL
${SOURCE_PATH}/lib/${BUILD_ARCH}/Debug/gmp.h
${SOURCE_PATH}/lib/${BUILD_ARCH}/Debug/gmpxx.h
${SOURCE_PATH}/lib/${BUILD_ARCH}/Debug/mpir.h
${SOURCE_PATH}/lib/${BUILD_ARCH}/Debug/mpirxx.h
DESTINATION ${CURRENT_PACKAGES_DIR}/include
)
file(INSTALL
${SOURCE_PATH}/lib/${BUILD_ARCH}/Debug/mpir.lib
DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib
)
file(INSTALL
${SOURCE_PATH}/lib/${BUILD_ARCH}/Release/mpir.lib
DESTINATION ${CURRENT_PACKAGES_DIR}/lib
)
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/mpir RENAME copyright)
endif()
message(STATUS "Installing done")

View File

@ -1,4 +1,4 @@
Source: wt
Version: 3.3.6
Version: 3.3.6-2
Description: Wt is a C++ library for developing web applications
Build-Depends: boost, openssl

View File

@ -0,0 +1,26 @@
diff --git a/cmake/WtFindBoost-cmake.txt b/cmake/WtFindBoost-cmake.txt
index b66741f..377cede 100644
--- a/cmake/WtFindBoost-cmake.txt
+++ b/cmake/WtFindBoost-cmake.txt
@@ -99,7 +99,7 @@ IF (Boost_FOUND)
SET(BOOST_WTHTTP_MT_FOUND TRUE)
SET(BOOST_WTHTTP_FOUND TRUE)
- IF(MSVC)
+ IF(MSVC AND NOT DISABLE_BOOST_AUTOLINK)
# use autolink
SET(BOOST_WT_LIBRARIES "")
SET(BOOST_WTHTTP_LIBRARIES "")
diff --git a/src/wt/Dbo/CMakeLists.txt b/src/wt/Dbo/CMakeLists.txt
index 64d3af2..f9c31e0 100644
--- a/src/wt/Dbo/CMakeLists.txt
+++ b/src/wt/Dbo/CMakeLists.txt
@@ -31,7 +31,7 @@ IF(ENABLE_LIBWTDBO)
StringStream.C
)
- IF(MSVC)
+ IF(MSVC AND NOT DISABLE_BOOST_AUTOLINK)
#win32 links automatically against boost libs; specifying too much causes
#trouble
IF(MULTI_THREADED_BUILD)

View File

@ -8,9 +8,13 @@ vcpkg_download_distfile(ARCHIVE_FILE
)
vcpkg_extract_source_archive(${ARCHIVE_FILE})
file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR})
vcpkg_apply_patches(
SOURCE_PATH ${SOURCE_PATH}
PATCHES ${CMAKE_CURRENT_LIST_DIR}/add-disable-boost-autolink-option.patch
)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
SOURCE_PATH ${SOURCE_PATH}
OPTIONS
-DSHARED_LIBS=ON
-DENABLE_SSL=ON
@ -20,6 +24,8 @@ SOURCE_PATH ${SOURCE_PATH}
-DENABLE_MYSQL=OFF
-DENABLE_QT4=OFF
-DBOOST_DYNAMIC=ON
-DDISABLE_BOOST_AUTOLINK=ON
-DENABLE_LIBWTTEST=OFF
)
vcpkg_install_cmake()

View File

@ -23,7 +23,10 @@ if (!(Test-Path $vcpkgSourcesPath))
try{
pushd $vcpkgSourcesPath
cmd /c "$env:VS140COMNTOOLS..\..\VC\vcvarsall.bat" x86 "&" msbuild "/p:VCPKG_VERSION=-$gitHash" "/p:DISABLE_METRICS=$disableMetrics" /p:Configuration=Release /p:Platform=x86 /m
$msbuildExeWithPlatformToolset = & $scriptsDir\findAnyMSBuildWithCppPlatformToolset.ps1
$msbuildExe = $msbuildExeWithPlatformToolset[0]
$platformToolset = $msbuildExeWithPlatformToolset[1]
& $msbuildExe "/p:VCPKG_VERSION=-$gitHash" "/p:DISABLE_METRICS=$disableMetrics" /p:Configuration=Release /p:Platform=x86 /p:PlatformToolset=$platformToolset /m
Write-Verbose("Placing vcpkg.exe in the correct location")

View File

@ -2,7 +2,14 @@
param([string]$targetBinary, [string]$installedDir, [string]$tlogFile)
function resolve($targetBinary) {
$targetBinaryPath = Resolve-Path $targetBinary
try
{
$targetBinaryPath = Resolve-Path $targetBinary -erroraction stop
}
catch [System.Management.Automation.ItemNotFoundException]
{
return
}
$targetBinaryDir = Split-Path $targetBinaryPath -parent
$a = $(dumpbin /DEPENDENTS $targetBinary | ? { $_ -match "^ [^ ].*\.dll" } | % { $_ -replace "^ ","" })

View File

@ -57,12 +57,14 @@
Lines="^$(OutputPath)$(TargetName).$(OutputType);" Encoding="Unicode"/>
<Exec Condition="'$(VcpkgConfiguration)' == 'Debug'"
Command="powershell.exe -ExecutionPolicy Unrestricted -noprofile -File %22$(MSBuildThisFileDirectory)applocal.ps1%22 %22$(TargetPath)%22 %22$(VcpkgRoot)debug\bin%22 %22$(TLogLocation)$(ProjectName).write.1u.tlog%22"
ConsoleToMSBuild="true">
ConsoleToMSBuild="true"
StandardOutputImportance="Normal">
<Output TaskParameter="ConsoleOutput" ItemName="ReferenceCopyLocalPaths" />
</Exec>
<Exec Condition="'$(VcpkgConfiguration)' == 'Release'"
Command="powershell.exe -ExecutionPolicy Unrestricted -noprofile -File %22$(MSBuildThisFileDirectory)applocal.ps1%22 %22$(TargetPath)%22 %22$(VcpkgRoot)bin%22 %22$(TLogLocation)$(ProjectName).write.1u.tlog%22"
ConsoleToMSBuild="true">
ConsoleToMSBuild="true"
StandardOutputImportance="Normal">
<Output TaskParameter="ConsoleOutput" ItemName="ReferenceCopyLocalPaths" />
</Exec>
</Target>

View File

@ -4,20 +4,33 @@ function(vcpkg_configure_cmake)
if(_csc_GENERATOR)
set(GENERATOR ${_csc_GENERATOR})
elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND TRIPLET_SYSTEM_ARCH MATCHES "x86")
elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND TRIPLET_SYSTEM_ARCH MATCHES "x86" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140")
set(GENERATOR "Visual Studio 14 2015")
elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND TRIPLET_SYSTEM_ARCH MATCHES "x64")
elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND TRIPLET_SYSTEM_ARCH MATCHES "x64" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140")
set(GENERATOR "Visual Studio 14 2015 Win64")
elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND TRIPLET_SYSTEM_ARCH MATCHES "arm")
elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND TRIPLET_SYSTEM_ARCH MATCHES "arm" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140")
set(GENERATOR "Visual Studio 14 2015 ARM")
# elseif(NOT vcpkg_configure_cmake_NINJA MATCHES "NOTFOUND")
# set(GENERATOR "Ninja")
elseif(TRIPLET_SYSTEM_ARCH MATCHES "x86")
elseif(TRIPLET_SYSTEM_ARCH MATCHES "x86" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140")
set(GENERATOR "Visual Studio 14 2015")
elseif(TRIPLET_SYSTEM_ARCH MATCHES "x64")
elseif(TRIPLET_SYSTEM_ARCH MATCHES "x64" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140")
set(GENERATOR "Visual Studio 14 2015 Win64")
elseif(TRIPLET_SYSTEM_ARCH MATCHES "arm")
set(GENERATOR "Visual Studio 14 2015 ARM")
set(GENERATOR "Visual Studio 14 2015 ARM" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140")
elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND TRIPLET_SYSTEM_ARCH MATCHES "x86" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141")
set(GENERATOR "Visual Studio 15 2017")
elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND TRIPLET_SYSTEM_ARCH MATCHES "x64" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141")
set(GENERATOR "Visual Studio 15 2017 Win64")
elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND TRIPLET_SYSTEM_ARCH MATCHES "arm" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141")
set(GENERATOR "Visual Studio 15 2017 ARM")
elseif(TRIPLET_SYSTEM_ARCH MATCHES "x86" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141")
set(GENERATOR "Visual Studio 15 2017")
elseif(TRIPLET_SYSTEM_ARCH MATCHES "x64" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141")
set(GENERATOR "Visual Studio 15 2017 Win64")
elseif(TRIPLET_SYSTEM_ARCH MATCHES "arm")
set(GENERATOR "Visual Studio 15 2017 ARM" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141")
endif()
file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg)
@ -33,7 +46,7 @@ function(vcpkg_configure_cmake)
elseif(DEFINED VCPKG_LIBRARY_LINKAGE AND VCPKG_LIBRARY_LINKAGE STREQUAL static)
list(APPEND _csc_OPTIONS -DBUILD_SHARED_LIBS=OFF)
endif()
list(APPEND _csc_OPTIONS
"-DCMAKE_CXX_FLAGS= /DWIN32 /D_WINDOWS /W3 /utf-8 /GR /EHsc"

View File

@ -51,12 +51,12 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency)
{
return
}
$title = "Download " + $Dependency
$message = ("No suitable version of " + $Dependency + " was found (requires $requiredVersion or higher). Download portable version?")
$yesDescription = "Downloads " + $Dependency + " v" + $downloadVersion +" app-locally."
$noDescription = "Does not download " + $Dependency + "."
$noDescription = "Does not download " + $Dependency + "."
$userAllowedDownload = promptForDownload $title $message $yesDescription $noDescription
if (!$userAllowedDownload)
{
@ -86,10 +86,10 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency)
$ExtractionType_NO_EXTRACTION_REQUIRED = 0
$ExtractionType_ZIP = 1
$ExtractionType_SELF_EXTRACTING_7Z = 2
# Using this to wait for the execution to finish
function Invoke-Command()
function Invoke-Command()
{
param ( [string]$program = $(throw "Please specify a program" ),
[string]$argumentString = "",
@ -99,7 +99,7 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency)
$psi.FileName = $program
$psi.Arguments = $argumentString
$proc = [Diagnostics.Process]::Start($psi)
if ( $waitForExit )
if ( $waitForExit )
{
$proc.WaitForExit();
}
@ -120,33 +120,33 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency)
if($Dependency -eq "cmake")
{
$requiredVersion = "3.5.0"
$downloadVersion = "3.5.2"
$url = "https://cmake.org/files/v3.5/cmake-3.5.2-win32-x86.zip"
$downloadName = "cmake-3.5.2-win32-x86.zip"
$expectedDownloadedFileHash = "671073aee66b3480a564d0736792e40570a11e861bb34819bb7ae7858bbdfb80"
$executableFromDownload = "$downloadsDir\cmake-3.5.2-win32-x86\bin\cmake.exe"
$requiredVersion = "3.7.2"
$downloadVersion = "3.7.2"
$url = "https://cmake.org/files/v3.7/cmake-3.7.2-win32-x86.zip"
$downloadPath = "$downloadsDir\cmake-3.7.2-win32-x86.zip"
$expectedDownloadedFileHash = "ec5e299d412e0272e01d4de5bf07718f42c96361f83d51cc39f91bf49cc3e5c3"
$executableFromDownload = "$downloadsDir\cmake-3.7.2-win32-x86\bin\cmake.exe"
$extractionType = $ExtractionType_ZIP
}
elseif($Dependency -eq "nuget")
{
$requiredVersion = "1.0.0"
$downloadVersion = "3.4.3"
$url = "https://dist.nuget.org/win-x86-commandline/v3.4.3/nuget.exe"
$downloadName = "nuget.exe"
$expectedDownloadedFileHash = "3B1EA72943968D7AF6BACDB4F2F3A048A25AFD14564EF1D8B1C041FDB09EBB0A"
$executableFromDownload = "$downloadsDir\nuget.exe"
$requiredVersion = "3.3.0"
$downloadVersion = "3.5.0"
$url = "https://dist.nuget.org/win-x86-commandline/v3.5.0/nuget.exe"
$downloadPath = "$downloadsDir\nuget-3.5.0\nuget.exe"
$expectedDownloadedFileHash = "399ec24c26ed54d6887cde61994bb3d1cada7956c1b19ff880f06f060c039918"
$executableFromDownload = $downloadPath
$extractionType = $ExtractionType_NO_EXTRACTION_REQUIRED
}
elseif($Dependency -eq "git")
{
$requiredVersion = "2.0.0"
$downloadVersion = "2.8.3"
$url = "https://github.com/git-for-windows/git/releases/download/v2.8.3.windows.1/PortableGit-2.8.3-32-bit.7z.exe" # We choose the 32-bit version
$downloadName = "PortableGit-2.8.3-32-bit.7z.exe"
$expectedDownloadedFileHash = "DE52D070219E9C4EC1DB179F2ADBF4B760686C3180608F0382A1F8C7031E72AD"
$downloadVersion = "2.11.0"
$url = "https://github.com/git-for-windows/git/releases/download/v2.11.0.windows.3/PortableGit-2.11.0.3-32-bit.7z.exe" # We choose the 32-bit version
$downloadPath = "$downloadsDir\PortableGit-2.11.0.3-32-bit.7z.exe"
$expectedDownloadedFileHash = "8bf3769c37945e991903dd1b988c6b1d97bbf0f3afc9851508974f38bf94dc01"
# There is another copy of git.exe in PortableGit\bin. However, an installed version of git add the cmd dir to the PATH.
# Therefore, choosing the cmd dir here as well.
# Therefore, choosing the cmd dir here as well.
$executableFromDownload = "$downloadsDir\PortableGit\cmd\git.exe"
$extractionType = $ExtractionType_SELF_EXTRACTING_7Z
}
@ -155,7 +155,12 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency)
throw "Unknown program requested"
}
$downloadPath = "$downloadsDir\$downloadName"
$downloadSubdir = Split-path $downloadPath -Parent
if (!(Test-Path $downloadSubdir))
{
New-Item -ItemType Directory -Path $downloadSubdir | Out-Null
}
performDownload $Dependency $url $downloadsDir $downloadPath $downloadVersion $requiredVersion
#calculating the hash
@ -186,7 +191,7 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency)
if (-not (Test-Path $executableFromDownload))
{
Invoke-Command $downloadPath "-y" -waitForExit:$true
}
}
}
else
{
@ -197,6 +202,8 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency)
{
throw [System.IO.FileNotFoundException] ("Could not detect or download " + $Dependency)
}
return $downloadPath
}
SelectProgram $Dependency

View File

@ -0,0 +1,32 @@
[CmdletBinding()]
param(
)
$scriptsDir = split-path -parent $MyInvocation.MyCommand.Definition
# VS2017
$VisualStudio2017InstallationInstances = & $scriptsDir\findVisualStudioInstallationInstances.ps1
foreach ($instance in $VisualStudio2017InstallationInstances)
{
$VCFolder= "$instance\VC\Tools\MSVC\"
if (Test-Path $VCFolder)
{
return "$instance\MSBuild\15.0\Bin\MSBuild.exe","v141"
}
}
# VS2015
$CandidateProgramFiles = "${env:PROGRAMFILES(X86)}", "${env:PROGRAMFILES}"
foreach ($ProgramFiles in $CandidateProgramFiles)
{
$clExe= "$ProgramFiles\Microsoft Visual Studio 14.0\\VC\bin\cl.exe"
if (Test-Path $clExe)
{
return "$ProgramFiles\MSBuild\14.0\Bin\MSBuild.exe","v140"
}
}
throw "Could not find MSBuild with C++ support. VS2015 or above with C++ support need to be installed."

View File

@ -0,0 +1,40 @@
[CmdletBinding()]
param(
)
Import-Module BitsTransfer
$scriptsDir = split-path -parent $MyInvocation.MyCommand.Definition
$vcpkgRootDir = & $scriptsDir\findFileRecursivelyUp.ps1 $scriptsDir .vcpkg-root
$downloadsDir = "$vcpkgRootDir\downloads"
$nugetexe = & $scriptsDir\fetchDependency.ps1 "nuget"
$nugetPackageDir = "$downloadsDir\nuget-packages"
$SetupAPIVersion = "1.3.269-rc"
$url = "https://api.nuget.org/packages/microsoft.visualstudio.setup.configuration.native.$SetupAPIVersion.nupkg"
$downloadName = "microsoft.visualstudio.setup.configuration.native.$SetupAPIVersion.nupkg"
$downloadPath = "$downloadsDir\$downloadName"
if (!(Test-Path $downloadPath))
{
Start-BitsTransfer -Source $url -Destination $downloadPath #-ErrorAction SilentlyContinue
}
$nugetOutput = & $nugetexe install Microsoft.VisualStudio.Setup.Configuration.Native -Pre -Source $downloadsDir -OutputDirectory $nugetPackageDir 2>&1
$SetupConsoleExe = "$nugetPackageDir\Microsoft.VisualStudio.Setup.Configuration.Native.$SetupAPIVersion\tools\x86\Microsoft.VisualStudio.Setup.Configuration.Console.exe"
if (!(Test-Path $SetupConsoleExe))
{
throw $nugetOutput
}
$consoleOutput = & $SetupConsoleExe 2>&1
$key = "InstallationPath = "
$paths = $consoleOutput | Select-String -SimpleMatch $key
$paths = $paths -replace $key, ""
return $paths

View File

@ -1 +1 @@
"0.0.67"
"0.0.70"

View File

@ -14,4 +14,14 @@ namespace vcpkg::Environment
ensure_cmake_on_path(paths);
ensure_git_on_path(paths);
}
const fs::path& get_dumpbin_exe(const vcpkg_paths& paths);
struct vcvarsall_and_platform_toolset
{
fs::path path;
std::wstring platform_toolset;
};
const vcvarsall_and_platform_toolset& get_vcvarsall_bat(const vcpkg_paths& paths);
}

View File

@ -75,4 +75,6 @@ namespace vcpkg::Strings
std::string trimmed(const std::string& s);
void trim_all_and_remove_whitespace_strings(std::vector<std::string>* strings);
std::vector<std::string> split(const std::string& s, const std::string& delimiter);
}

View File

@ -24,6 +24,7 @@ namespace vcpkg
fs::path ports;
fs::path installed;
fs::path triplets;
fs::path scripts;
fs::path buildsystems;
fs::path buildsystems_msbuild_targets;

View File

@ -30,10 +30,13 @@ namespace vcpkg::Commands::Build
const triplet& target_triplet = spec.target_triplet();
const fs::path ports_cmake_script_path = paths.ports_cmake;
const std::wstring command = Strings::wformat(LR"("%%VS140COMNTOOLS%%..\..\VC\vcvarsall.bat" %s && cmake -DCMD=BUILD -DPORT=%s -DTARGET_TRIPLET=%s "-DCURRENT_PORT_DIR=%s/." -P "%s")",
const Environment::vcvarsall_and_platform_toolset vcvarsall_bat = Environment::get_vcvarsall_bat(paths);
const std::wstring command = Strings::wformat(LR"("%s" %s >nul 2>&1 && cmake -DCMD=BUILD -DPORT=%s -DTARGET_TRIPLET=%s -DVCPKG_PLATFORM_TOOLSET=%s "-DCURRENT_PORT_DIR=%s/." -P "%s")",
vcvarsall_bat.path.native(),
Strings::utf8_to_utf16(target_triplet.architecture()),
Strings::utf8_to_utf16(source_paragraph.name),
Strings::utf8_to_utf16(target_triplet.canonical_name()),
vcvarsall_bat.platform_toolset,
port_dir.generic_wstring(),
ports_cmake_script_path.generic_wstring());

View File

@ -3,6 +3,7 @@
#include "vcpkg_Files.h"
#include <functional>
#include "vcpkg_System.h"
#include "vcpkg_Environment.h"
#include "coff_file_reader.h"
#include "BuildInfo.h"
#include <regex>
@ -15,8 +16,6 @@ namespace vcpkg::PostBuildLint
ERROR_DETECTED = 1
};
static const fs::path DUMPBIN_EXE = R"(%VS140COMNTOOLS%\..\..\VC\bin\dumpbin.exe)";
static lint_status check_for_files_in_include_directory(const fs::path& package_dir)
{
const fs::path include_dir = package_dir / "include";
@ -185,12 +184,12 @@ namespace vcpkg::PostBuildLint
return lint_status::SUCCESS;
}
static lint_status check_exports_of_dlls(const std::vector<fs::path>& dlls)
static lint_status check_exports_of_dlls(const std::vector<fs::path>& dlls, const fs::path& dumpbin_exe)
{
std::vector<fs::path> dlls_with_no_exports;
for (const fs::path& dll : dlls)
{
const std::wstring cmd_line = Strings::wformat(LR"("%s" /exports "%s")", DUMPBIN_EXE.native(), dll.native());
const std::wstring cmd_line = Strings::wformat(LR"("%s" /exports "%s")", dumpbin_exe.native(), dll.native());
System::exit_code_and_output ec_data = System::cmd_execute_and_capture_output(cmd_line);
Checks::check_exit(ec_data.exit_code == 0, "Running command:\n %s\n failed", Strings::utf16_to_utf8(cmd_line));
@ -211,7 +210,7 @@ namespace vcpkg::PostBuildLint
return lint_status::SUCCESS;
}
static lint_status check_uwp_bit_of_dlls(const std::string& expected_system_name, const std::vector<fs::path>& dlls)
static lint_status check_uwp_bit_of_dlls(const std::string& expected_system_name, const std::vector<fs::path>& dlls, const fs::path dumpbin_exe)
{
if (expected_system_name != "uwp")
{
@ -221,7 +220,7 @@ namespace vcpkg::PostBuildLint
std::vector<fs::path> dlls_with_improper_uwp_bit;
for (const fs::path& dll : dlls)
{
const std::wstring cmd_line = Strings::wformat(LR"("%s" /headers "%s")", DUMPBIN_EXE.native(), dll.native());
const std::wstring cmd_line = Strings::wformat(LR"("%s" /headers "%s")", dumpbin_exe.native(), dll.native());
System::exit_code_and_output ec_data = System::cmd_execute_and_capture_output(cmd_line);
Checks::check_exit(ec_data.exit_code == 0, "Running command:\n %s\n failed", Strings::utf16_to_utf8(cmd_line));
@ -459,7 +458,7 @@ namespace vcpkg::PostBuildLint
BuildType build_type;
};
static lint_status check_crt_linkage_of_libs(const BuildType& expected_build_type, const std::vector<fs::path>& libs)
static lint_status check_crt_linkage_of_libs(const BuildType& expected_build_type, const std::vector<fs::path>& libs, const fs::path dumpbin_exe)
{
std::vector<BuildType> bad_build_types = BuildType::values();
bad_build_types.erase(std::remove(bad_build_types.begin(), bad_build_types.end(), expected_build_type), bad_build_types.end());
@ -468,7 +467,7 @@ namespace vcpkg::PostBuildLint
for (const fs::path& lib : libs)
{
const std::wstring cmd_line = Strings::wformat(LR"("%s" /directives "%s")", DUMPBIN_EXE.native(), lib.native());
const std::wstring cmd_line = Strings::wformat(LR"("%s" /directives "%s")", dumpbin_exe.native(), lib.native());
System::exit_code_and_output ec_data = System::cmd_execute_and_capture_output(cmd_line);
Checks::check_exit(ec_data.exit_code == 0, "Running command:\n %s\n failed", Strings::utf16_to_utf8(cmd_line));
@ -505,7 +504,7 @@ namespace vcpkg::PostBuildLint
OutdatedDynamicCrt outdated_crt;
};
static lint_status check_outdated_crt_linkage_of_dlls(const std::vector<fs::path>& dlls)
static lint_status check_outdated_crt_linkage_of_dlls(const std::vector<fs::path>& dlls, const fs::path dumpbin_exe)
{
const std::vector<OutdatedDynamicCrt>& outdated_crts = OutdatedDynamicCrt::values();
@ -513,7 +512,7 @@ namespace vcpkg::PostBuildLint
for (const fs::path& dll : dlls)
{
const std::wstring cmd_line = Strings::wformat(LR"("%s" /dependents "%s")", DUMPBIN_EXE.native(), dll.native());
const std::wstring cmd_line = Strings::wformat(LR"("%s" /dependents "%s")", dumpbin_exe.native(), dll.native());
System::exit_code_and_output ec_data = System::cmd_execute_and_capture_output(cmd_line);
Checks::check_exit(ec_data.exit_code == 0, "Running command:\n %s\n failed", Strings::utf16_to_utf8(cmd_line));
@ -575,6 +574,8 @@ namespace vcpkg::PostBuildLint
void perform_all_checks(const package_spec& spec, const vcpkg_paths& paths)
{
const fs::path dumpbin_exe = Environment::get_dumpbin_exe(paths);
System::println("-- Performing post-build validation");
BuildInfo build_info = read_build_info(paths.build_info_file_path(spec));
@ -623,11 +624,11 @@ namespace vcpkg::PostBuildLint
dlls.insert(dlls.cend(), debug_dlls.cbegin(), debug_dlls.cend());
dlls.insert(dlls.cend(), release_dlls.cbegin(), release_dlls.cend());
error_count += check_exports_of_dlls(dlls);
error_count += check_uwp_bit_of_dlls(spec.target_triplet().system(), dlls);
error_count += check_exports_of_dlls(dlls, dumpbin_exe);
error_count += check_uwp_bit_of_dlls(spec.target_triplet().system(), dlls, dumpbin_exe);
error_count += check_dll_architecture(spec.target_triplet().architecture(), dlls);
error_count += check_outdated_crt_linkage_of_dlls(dlls);
error_count += check_outdated_crt_linkage_of_dlls(dlls, dumpbin_exe);
break;
}
case LinkageType::STATIC:
@ -638,8 +639,8 @@ namespace vcpkg::PostBuildLint
error_count += check_bin_folders_are_not_present_in_static_build(package_dir);
error_count += check_crt_linkage_of_libs(BuildType::value_of(ConfigurationType::DEBUG, linkage_type_value_of(build_info.crt_linkage)), debug_libs);
error_count += check_crt_linkage_of_libs(BuildType::value_of(ConfigurationType::RELEASE, linkage_type_value_of(build_info.crt_linkage)), release_libs);
error_count += check_crt_linkage_of_libs(BuildType::value_of(ConfigurationType::DEBUG, linkage_type_value_of(build_info.crt_linkage)), debug_libs, dumpbin_exe);
error_count += check_crt_linkage_of_libs(BuildType::value_of(ConfigurationType::RELEASE, linkage_type_value_of(build_info.crt_linkage)), release_libs, dumpbin_exe);
break;
}
case LinkageType::UNKNOWN:

View File

@ -4,6 +4,8 @@
#include "vcpkg_Commands.h"
#include "metrics.h"
#include "vcpkg_System.h"
#include "vcpkg_Strings.h"
#include "vcpkg_Files.h"
namespace vcpkg::Environment
{
@ -12,7 +14,7 @@ namespace vcpkg::Environment
static const fs::path default_git_installation_dir = "C:/Program Files/git/cmd";
static const fs::path default_git_installation_dir_x86 = "C:/Program Files (x86)/git/cmd";
static void ensure_on_path(const std::array<int, 3>& version, const wchar_t* version_check_cmd, const wchar_t* install_cmd)
static void ensure_on_path(const std::array<int, 3>& version, const std::wstring& version_check_cmd, const std::wstring& install_cmd)
{
System::exit_code_and_output ec_data = System::cmd_execute_and_capture_output(version_check_cmd);
if (ec_data.exit_code == 0)
@ -44,6 +46,13 @@ namespace vcpkg::Environment
}
}
static std::wstring create_default_install_cmd(const vcpkg_paths& paths, const std::wstring& tool_name)
{
const fs::path script = paths.scripts / "fetchDependency.ps1";
// TODO: switch out ExecutionPolicy Bypass with "Remove Mark Of The Web" code and restore RemoteSigned
return Strings::wformat(L"powershell -ExecutionPolicy Bypass %s -Dependency %s", script.native(), tool_name);
}
void ensure_git_on_path(const vcpkg_paths& paths)
{
const fs::path downloaded_git = paths.downloads / "PortableGit" / "cmd";
@ -55,13 +64,14 @@ namespace vcpkg::Environment
_wputenv_s(L"PATH", path_buf.c_str());
static constexpr std::array<int, 3> git_version = {2,0,0};
// TODO: switch out ExecutionPolicy Bypass with "Remove Mark Of The Web" code and restore RemoteSigned
ensure_on_path(git_version, L"git --version 2>&1", L"powershell -ExecutionPolicy Bypass scripts\\fetchDependency.ps1 -Dependency git");
static const std::wstring version_check_cmd = L"git --version 2>&1";
const std::wstring install_cmd = create_default_install_cmd(paths, L"git");
ensure_on_path(git_version, version_check_cmd, install_cmd);
}
void ensure_cmake_on_path(const vcpkg_paths& paths)
{
const fs::path downloaded_cmake = paths.downloads / "cmake-3.5.2-win32-x86" / "bin";
const fs::path downloaded_cmake = paths.downloads / "cmake-3.7.2-win32-x86" / "bin";
const std::wstring path_buf = Strings::wformat(L"%s;%s;%s;%s",
downloaded_cmake.native(),
System::wdupenv_str(L"PATH"),
@ -69,18 +79,131 @@ namespace vcpkg::Environment
default_cmake_installation_dir_x86.native());
_wputenv_s(L"PATH", path_buf.c_str());
static constexpr std::array<int, 3> cmake_version = {3,5,0};
// TODO: switch out ExecutionPolicy Bypass with "Remove Mark Of The Web" code and restore RemoteSigned
ensure_on_path(cmake_version, L"cmake --version 2>&1", L"powershell -ExecutionPolicy Bypass scripts\\fetchDependency.ps1 -Dependency cmake");
static constexpr std::array<int, 3> cmake_version = {3,7,2};
static const std::wstring version_check_cmd = L"cmake --version 2>&1";
const std::wstring install_cmd = create_default_install_cmd(paths, L"cmake");
ensure_on_path(cmake_version, version_check_cmd, install_cmd);
}
void ensure_nuget_on_path(const vcpkg_paths& paths)
{
const std::wstring path_buf = Strings::wformat(L"%s;%s", paths.downloads.native(), System::wdupenv_str(L"PATH"));
const fs::path downloaded_nuget = paths.downloads / "nuget-3.5.0";
const std::wstring path_buf = Strings::wformat(L"%s;%s", downloaded_nuget.native(), System::wdupenv_str(L"PATH"));
_wputenv_s(L"PATH", path_buf.c_str());
static constexpr std::array<int, 3> nuget_version = {1,0,0};
// TODO: switch out ExecutionPolicy Bypass with "Remove Mark Of The Web" code and restore RemoteSigned
ensure_on_path(nuget_version, L"nuget 2>&1", L"powershell -ExecutionPolicy Bypass scripts\\fetchDependency.ps1 -Dependency nuget");
static constexpr std::array<int, 3> nuget_version = {3,3,0};
static const std::wstring version_check_cmd = L"nuget 2>&1";
const std::wstring install_cmd = create_default_install_cmd(paths, L"nuget");
ensure_on_path(nuget_version, version_check_cmd, install_cmd);
}
static std::vector<std::string> get_VS2017_installation_instances(const vcpkg_paths& paths)
{
const fs::path script = paths.scripts / "findVisualStudioInstallationInstances.ps1";
const std::wstring cmd = Strings::wformat(L"powershell -ExecutionPolicy Bypass %s", script.native());
System::exit_code_and_output ec_data = System::cmd_execute_and_capture_output(cmd);
Checks::check_exit(ec_data.exit_code == 0, "Could not run script to detect VS 2017 instances");
return Strings::split(ec_data.output, "\n");
}
static const fs::path& get_VS2015_installation_instance()
{
static const fs::path vs2015_cmntools = fs::path(System::wdupenv_str(L"VS140COMNTOOLS")).parent_path(); // The call to parent_path() is needed because the env variable has a trailing backslash
static const fs::path vs2015_path = vs2015_cmntools.parent_path().parent_path();
return vs2015_path;
}
static fs::path find_dumpbin_exe(const vcpkg_paths& paths)
{
const std::vector<std::string> vs2017_installation_instances = get_VS2017_installation_instances(paths);
std::vector<fs::path> paths_examined;
// VS2017
for (const std::string& instance : vs2017_installation_instances)
{
const fs::path msvc_path = Strings::format(R"(%s\VC\Tools\MSVC)", instance);
std::vector<fs::path> msvc_subdirectories;
Files::non_recursive_find_matching_paths_in_dir(msvc_path, [&](const fs::path& current)
{
return fs::is_directory(current);
}, &msvc_subdirectories);
// Sort them so that latest comes first
std::sort(msvc_subdirectories.begin(), msvc_subdirectories.end(), [&](const fs::path& left, const fs::path& right)
{
return left.filename() > right.filename();
});
for (const fs::path& subdir : msvc_subdirectories)
{
const fs::path dumpbin_path = subdir / "bin" / "HostX86" / "x86" / "dumpbin.exe";
paths_examined.push_back(dumpbin_path);
if (fs::exists(dumpbin_path))
{
return dumpbin_path;
}
}
}
// VS2015
const fs::path vs2015_dumpbin_exe = get_VS2015_installation_instance() / "VC" / "bin" / "dumpbin.exe";
paths_examined.push_back(vs2015_dumpbin_exe);
if (fs::exists(vs2015_dumpbin_exe))
{
return vs2015_dumpbin_exe;
}
System::println(System::color::error, "Could not detect dumpbin.exe.");
System::println("The following paths were examined:");
for (const fs::path& path : paths_examined)
{
System::println(" %s", path.generic_string());
}
exit(EXIT_FAILURE);
}
const fs::path& get_dumpbin_exe(const vcpkg_paths& paths)
{
static const fs::path dumpbin_exe = find_dumpbin_exe(paths);
return dumpbin_exe;
}
static vcvarsall_and_platform_toolset find_vcvarsall_bat(const vcpkg_paths& paths)
{
const std::vector<std::string> vs2017_installation_instances = get_VS2017_installation_instances(paths);
std::vector<fs::path> paths_examined;
// VS2017
for (const fs::path& instance : vs2017_installation_instances)
{
const fs::path vcvarsall_bat = instance / "VC" / "Auxiliary" / "Build" / "vcvarsall.bat";
paths_examined.push_back(vcvarsall_bat);
if (fs::exists(vcvarsall_bat))
{
return { vcvarsall_bat , L"v141"};
}
}
// VS2015
const fs::path vs2015_vcvarsall_bat = get_VS2015_installation_instance() / "VC" / "vcvarsall.bat";
paths_examined.push_back(vs2015_vcvarsall_bat);
if (fs::exists(vs2015_vcvarsall_bat))
{
return { vs2015_vcvarsall_bat, L"v140" };
}
System::println(System::color::error, "Could not detect vccarsall.bat.");
System::println("The following paths were examined:");
for (const fs::path& path : paths_examined)
{
System::println(" %s",path.generic_string());
}
exit(EXIT_FAILURE);
}
const vcvarsall_and_platform_toolset& get_vcvarsall_bat(const vcpkg_paths& paths)
{
static const vcvarsall_and_platform_toolset vcvarsall_bat = find_vcvarsall_bat(paths);
return vcvarsall_bat;
}
}

View File

@ -119,4 +119,24 @@ namespace vcpkg::Strings
return s == "";
}), strings->end());
}
std::vector<std::string> split(const std::string& s, const std::string& delimiter)
{
std::vector<std::string> output;
size_t i = 0;
for (size_t pos = s.find(delimiter); pos != std::string::npos; pos = s.find(delimiter, pos))
{
output.push_back(s.substr(i, pos - i));
i = ++pos;
}
// Add the rest of the string after the last delimiter, unless there is nothing after it
if (i != s.length())
{
output.push_back(s.substr(i, s.length()));
}
return output;
}
}

View File

@ -31,8 +31,9 @@ namespace vcpkg
paths.ports = paths.root / "ports";
paths.installed = paths.root / "installed";
paths.triplets = paths.root / "triplets";
paths.scripts = paths.root / "scripts";
paths.buildsystems = paths.root / "scripts" / "buildsystems";
paths.buildsystems = paths.scripts / "buildsystems";
paths.buildsystems_msbuild_targets = paths.buildsystems / "msbuild" / "vcpkg.targets";
paths.vcpkg_dir = paths.installed / "vcpkg";
@ -40,7 +41,7 @@ namespace vcpkg
paths.vcpkg_dir_info = paths.vcpkg_dir / "info";
paths.vcpkg_dir_updates = paths.vcpkg_dir / "updates";
paths.ports_cmake = paths.root / "scripts" / "ports.cmake";
paths.ports_cmake = paths.scripts / "ports.cmake";
return paths;
}

View File

@ -22,31 +22,28 @@
<ProjectGuid>{34671B80-54F9-46F5-8310-AC429C11D4FB}</ProjectGuid>
<RootNamespace>vcpkg</RootNamespace>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
<PlatformToolset Condition="'$(PlatformToolset)' == ''">v140</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>

View File

@ -22,31 +22,28 @@
<ProjectGuid>{7129F242-F20C-43E7-BBEC-4E15B71890B2}</ProjectGuid>
<RootNamespace>vcpkgcommon</RootNamespace>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
<PlatformToolset Condition="'$(PlatformToolset)' == ''">v140</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>

View File

@ -22,31 +22,28 @@
<ProjectGuid>{B98C92B7-2874-4537-9D46-D14E5C237F04}</ProjectGuid>
<RootNamespace>vcpkglib</RootNamespace>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
<PlatformToolset Condition="'$(PlatformToolset)' == ''">v140</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>

View File

@ -22,31 +22,28 @@
<ProjectGuid>{7226078C-1D2A-4123-9EF1-8DF2B722B8F1}</ProjectGuid>
<RootNamespace>vcpkgmetrics</RootNamespace>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
<PlatformToolset Condition="'$(PlatformToolset)' == ''">v140</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>

View File

@ -22,31 +22,28 @@
<ProjectGuid>{7D6FDEEB-B299-4A23-85EE-F67C4DED47BE}</ProjectGuid>
<RootNamespace>vcpkgmetricsuploader</RootNamespace>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
<PlatformToolset Condition="'$(PlatformToolset)' == ''">v140</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>

View File

@ -38,19 +38,18 @@
<Keyword>Win32Proj</Keyword>
<RootNamespace>vcpkgtest</RootNamespace>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
<PlatformToolset Condition="'$(PlatformToolset)' == ''">v140</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<UseOfMfc>false</UseOfMfc>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<UseOfMfc>false</UseOfMfc>
@ -58,14 +57,12 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<UseOfMfc>false</UseOfMfc>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<UseOfMfc>false</UseOfMfc>