From 904942197d3e79feff1d0c6d76aa5c002456b085 Mon Sep 17 00:00:00 2001 From: Dengke Tang <815825145@qq.com> Date: Wed, 23 Nov 2022 09:41:25 -0800 Subject: [PATCH] fix win build (#72) --- README.md | 9 ++++++++- config.w32 | 4 ++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d942eb0..e793483 100644 --- a/README.md +++ b/README.md @@ -51,10 +51,17 @@ C:\php-sdk\php-\vc15\x64\php-src $ nmake test-awscrt ``` +Note: for VS2017, Cmake will default to build for Win32, refer to [here](https://cmake.org/cmake/help/latest/generator/Visual%20Studio%2015%202017.html). If you are building for x64 php, you can set environment variable as follow to let cmake pick x64 compiler. + +```bat +set CMAKE_GENERATOR=Visual Studio 15 2017 +set CMAKE_GENERATOR_PLATFORM=x64 +``` + ## Debugging Using [PHPBrew](https://github.com/phpbrew/phpbrew) to build/manage multiple versions of PHP is helpful. -Note: You must use a debug build of PHP to debug native extensions. +Note: You must use a debug build of PHP to debug native extensions. See the [PHP Internals Book](https://www.phpinternalsbook.com/php7/build_system/building_php.html) for more info ```shell diff --git a/config.w32 b/config.w32 index ed08402..d9b89e0 100644 --- a/config.w32 +++ b/config.w32 @@ -5,8 +5,8 @@ ARG_ENABLE("awscrt", "Include AWS Common Runtime support", "yes"); if (PHP_AWSCRT != "no") { ADD_MAKEFILE_FRAGMENT(); DEFINE('CFLAGS_AWSCRT', '/I ' + configure_module_dirname + '\\build\\install\\include'); - DEFINE('LIBS_AWSCRT', '/LIBPATH:' + configure_module_dirname + '\\build\\install\\lib ' + - 'aws-crt-ffi.lib aws-c-auth.lib aws-c-http.lib aws-c-io.lib aws-c-cal.lib aws-c-compression.lib aws-c-common.lib ' + + DEFINE('LIBS_AWSCRT', '/LIBPATH:' + configure_module_dirname + '\\build\\install\\lib ' + + 'aws-crt-ffi.lib aws-c-auth.lib aws-c-http.lib aws-c-io.lib aws-c-cal.lib aws-c-compression.lib aws-checksums.lib aws-c-common.lib ' + 'ncrypt.lib Secur32.lib Crypt32.lib Shlwapi.lib'); DEFINE('AWSCRT_DIR', configure_module_dirname); EXTENSION("awscrt", "ext\\awscrt.c", PHP_AWSCRT_SHARED);