Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
环境:VS2015 Community
目标:PHP 7.0.2 源码忘记更新了,不过对API影响甚微
参考: https://wiki.php.net/internals/windows/stepbystepbuild
没有VC14目录自己仿照现有的创建。
https://bintray.com/byvoid/opencc/OpenCC/1.0.1/view
解压到某个位置,如D:\Local\opencc-1.0.1-win64。
进入D:\Local\php-sdk,运行一次
bin\phpsdk_setvars.bat
设置变量buildconf
生成configure.js
,通过configure --help
确认opencc是否加入编译选项。configure --disable-all --disable-zts --enable-cli --with-opencc=shared,D:\Local\opencc-1.0.1-win64
做最小编译,请根据ZTS、Debug/Release与否调整相应参数,--with-opencc中的shared表示编译为共享DLL模块,否则将被编入php.dll,OpenCC目录务必填写正确。nmake
开始编译。php_opencc.dll
,不再列举了。复制到php的ext
目录、添加php.ini
亦不再赘述。php_opencc.dll
本身不连接OpenCC,需要把OpenCC目录下的opencc.dll
复制到php根目录(不是ext
,和php.exe
在一起),和其他DLL一个原理。php -m
检查是否正确加载扩展D:\Local\opencc-1.0.1-win64\t2s.json
That's all. 如果目标和我一致可以拿走无责任成品:
https://drive.google.com/open?id=0B-cvAlivZFgkM1A4aktKTklMMXM