Skip to content

Commit

Permalink
Modify PhpApi.vcxproj to call swig as though it was vanilla
Browse files Browse the repository at this point in the history
  • Loading branch information
jumpinjackie committed May 26, 2018
1 parent 93f216b commit efdc887
Show file tree
Hide file tree
Showing 7 changed files with 92 additions and 18 deletions.
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ obj
/src/Bindings/DotNet/MapGuideDotNetApi/*.cs
/src/Bindings/MapGuideApi
/src/Bindings/ipch
/src/Bindings/Php/MapGuideApi.i
/src/Bindings/Php/MapGuideApi_Doc.i
/src/Bindings/Php/language.i
/src/Bindings/Php/MgApi_wrap.cpp
/src/Bindings/Php/MapGuideApi.php
/src/Bindings/Php/php_MapGuideApi.h
/src/IMake/.vs
/src/lib
/src/IMake/Release
Expand Down Expand Up @@ -68,4 +74,5 @@ swig-3.0.12.tar.gz
/src/FileReplace/bin/*.ipdb
/src/FileReplace/bin/*.pdb
/src/Tools/StampVer/bin
/src/Tools/artifacts
/src/Tools/artifacts
constants.php
53 changes: 53 additions & 0 deletions src/Bindings/Bindings.sln
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,27 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".net API", ".net API", "{A9
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{99132700-5CAD-4540-9939-7502C1A448EA}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "PHP API", "PHP API", "{323AEA7C-774B-49D8-8D34-7A766288C549}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PhpApi", "Php\PhpApi.vcxproj", "{696D2664-D17F-4357-8A19-2B5DC4B29962}"
ProjectSection(ProjectDependencies) = postProject
{B601F04C-0D42-4AFC-A092-B31185E2EA8C} = {B601F04C-0D42-4AFC-A092-B31185E2EA8C}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug_VC11|x64 = Debug_VC11|x64
Debug_VC11|x86 = Debug_VC11|x86
Debug_VC14|x64 = Debug_VC14|x64
Debug_VC14|x86 = Debug_VC14|x86
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release_VC11|x64 = Release_VC11|x64
Release_VC11|x86 = Release_VC11|x86
Release_VC14|x64 = Release_VC14|x64
Release_VC14|x86 = Release_VC14|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{FDC09E9D-72BB-4C74-B88B-727D9D1D6C4E}.Debug_VC11|x64.ActiveCfg = Debug_VC11|x64
Expand All @@ -36,6 +47,10 @@ Global
{FDC09E9D-72BB-4C74-B88B-727D9D1D6C4E}.Debug_VC14|x64.Build.0 = Debug_VC14|x64
{FDC09E9D-72BB-4C74-B88B-727D9D1D6C4E}.Debug_VC14|x86.ActiveCfg = Debug_VC14|Win32
{FDC09E9D-72BB-4C74-B88B-727D9D1D6C4E}.Debug_VC14|x86.Build.0 = Debug_VC14|Win32
{FDC09E9D-72BB-4C74-B88B-727D9D1D6C4E}.Debug|x64.ActiveCfg = Debug_VC14|x64
{FDC09E9D-72BB-4C74-B88B-727D9D1D6C4E}.Debug|x64.Build.0 = Debug_VC14|x64
{FDC09E9D-72BB-4C74-B88B-727D9D1D6C4E}.Debug|x86.ActiveCfg = Debug_VC14|Win32
{FDC09E9D-72BB-4C74-B88B-727D9D1D6C4E}.Debug|x86.Build.0 = Debug_VC14|Win32
{FDC09E9D-72BB-4C74-B88B-727D9D1D6C4E}.Release_VC11|x64.ActiveCfg = Release_VC11|x64
{FDC09E9D-72BB-4C74-B88B-727D9D1D6C4E}.Release_VC11|x64.Build.0 = Release_VC11|x64
{FDC09E9D-72BB-4C74-B88B-727D9D1D6C4E}.Release_VC11|x86.ActiveCfg = Release_VC11|Win32
Expand All @@ -44,6 +59,10 @@ Global
{FDC09E9D-72BB-4C74-B88B-727D9D1D6C4E}.Release_VC14|x64.Build.0 = Release_VC14|x64
{FDC09E9D-72BB-4C74-B88B-727D9D1D6C4E}.Release_VC14|x86.ActiveCfg = Release_VC14|Win32
{FDC09E9D-72BB-4C74-B88B-727D9D1D6C4E}.Release_VC14|x86.Build.0 = Release_VC14|Win32
{FDC09E9D-72BB-4C74-B88B-727D9D1D6C4E}.Release|x64.ActiveCfg = Release_VC14|x64
{FDC09E9D-72BB-4C74-B88B-727D9D1D6C4E}.Release|x64.Build.0 = Release_VC14|x64
{FDC09E9D-72BB-4C74-B88B-727D9D1D6C4E}.Release|x86.ActiveCfg = Release_VC14|Win32
{FDC09E9D-72BB-4C74-B88B-727D9D1D6C4E}.Release|x86.Build.0 = Release_VC14|Win32
{B601F04C-0D42-4AFC-A092-B31185E2EA8C}.Debug_VC11|x64.ActiveCfg = Debug|Win32
{B601F04C-0D42-4AFC-A092-B31185E2EA8C}.Debug_VC11|x64.Build.0 = Debug|Win32
{B601F04C-0D42-4AFC-A092-B31185E2EA8C}.Debug_VC11|x64.Deploy.0 = Debug|Win32
Expand All @@ -54,6 +73,9 @@ Global
{B601F04C-0D42-4AFC-A092-B31185E2EA8C}.Debug_VC14|x64.Deploy.0 = Debug|Win32
{B601F04C-0D42-4AFC-A092-B31185E2EA8C}.Debug_VC14|x86.ActiveCfg = Debug|Win32
{B601F04C-0D42-4AFC-A092-B31185E2EA8C}.Debug_VC14|x86.Build.0 = Debug|Win32
{B601F04C-0D42-4AFC-A092-B31185E2EA8C}.Debug|x64.ActiveCfg = Debug|Win32
{B601F04C-0D42-4AFC-A092-B31185E2EA8C}.Debug|x86.ActiveCfg = Debug|Win32
{B601F04C-0D42-4AFC-A092-B31185E2EA8C}.Debug|x86.Build.0 = Debug|Win32
{B601F04C-0D42-4AFC-A092-B31185E2EA8C}.Release_VC11|x64.ActiveCfg = Release|Win32
{B601F04C-0D42-4AFC-A092-B31185E2EA8C}.Release_VC11|x64.Build.0 = Release|Win32
{B601F04C-0D42-4AFC-A092-B31185E2EA8C}.Release_VC11|x64.Deploy.0 = Release|Win32
Expand All @@ -65,12 +87,43 @@ Global
{B601F04C-0D42-4AFC-A092-B31185E2EA8C}.Release_VC14|x86.ActiveCfg = Release|Win32
{B601F04C-0D42-4AFC-A092-B31185E2EA8C}.Release_VC14|x86.Build.0 = Release|Win32
{B601F04C-0D42-4AFC-A092-B31185E2EA8C}.Release_VC14|x86.Deploy.0 = Release|Win32
{B601F04C-0D42-4AFC-A092-B31185E2EA8C}.Release|x64.ActiveCfg = Release|Win32
{B601F04C-0D42-4AFC-A092-B31185E2EA8C}.Release|x86.ActiveCfg = Release|Win32
{B601F04C-0D42-4AFC-A092-B31185E2EA8C}.Release|x86.Build.0 = Release|Win32
{696D2664-D17F-4357-8A19-2B5DC4B29962}.Debug_VC11|x64.ActiveCfg = Debug|x64
{696D2664-D17F-4357-8A19-2B5DC4B29962}.Debug_VC11|x64.Build.0 = Debug|x64
{696D2664-D17F-4357-8A19-2B5DC4B29962}.Debug_VC11|x86.ActiveCfg = Debug|Win32
{696D2664-D17F-4357-8A19-2B5DC4B29962}.Debug_VC11|x86.Build.0 = Debug|Win32
{696D2664-D17F-4357-8A19-2B5DC4B29962}.Debug_VC14|x64.ActiveCfg = Debug|x64
{696D2664-D17F-4357-8A19-2B5DC4B29962}.Debug_VC14|x64.Build.0 = Debug|x64
{696D2664-D17F-4357-8A19-2B5DC4B29962}.Debug_VC14|x86.ActiveCfg = Debug|Win32
{696D2664-D17F-4357-8A19-2B5DC4B29962}.Debug_VC14|x86.Build.0 = Debug|Win32
{696D2664-D17F-4357-8A19-2B5DC4B29962}.Debug|x64.ActiveCfg = Debug|x64
{696D2664-D17F-4357-8A19-2B5DC4B29962}.Debug|x64.Build.0 = Debug|x64
{696D2664-D17F-4357-8A19-2B5DC4B29962}.Debug|x86.ActiveCfg = Debug|Win32
{696D2664-D17F-4357-8A19-2B5DC4B29962}.Debug|x86.Build.0 = Debug|Win32
{696D2664-D17F-4357-8A19-2B5DC4B29962}.Release_VC11|x64.ActiveCfg = Release|x64
{696D2664-D17F-4357-8A19-2B5DC4B29962}.Release_VC11|x64.Build.0 = Release|x64
{696D2664-D17F-4357-8A19-2B5DC4B29962}.Release_VC11|x86.ActiveCfg = Release|Win32
{696D2664-D17F-4357-8A19-2B5DC4B29962}.Release_VC11|x86.Build.0 = Release|Win32
{696D2664-D17F-4357-8A19-2B5DC4B29962}.Release_VC14|x64.ActiveCfg = Release|x64
{696D2664-D17F-4357-8A19-2B5DC4B29962}.Release_VC14|x64.Build.0 = Release|x64
{696D2664-D17F-4357-8A19-2B5DC4B29962}.Release_VC14|x86.ActiveCfg = Release|Win32
{696D2664-D17F-4357-8A19-2B5DC4B29962}.Release_VC14|x86.Build.0 = Release|Win32
{696D2664-D17F-4357-8A19-2B5DC4B29962}.Release|x64.ActiveCfg = Release|x64
{696D2664-D17F-4357-8A19-2B5DC4B29962}.Release|x64.Build.0 = Release|x64
{696D2664-D17F-4357-8A19-2B5DC4B29962}.Release|x86.ActiveCfg = Release|Win32
{696D2664-D17F-4357-8A19-2B5DC4B29962}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{FDC09E9D-72BB-4C74-B88B-727D9D1D6C4E} = {A9257857-9844-4CEA-AF02-A7D8AB8F46AB}
{B601F04C-0D42-4AFC-A092-B31185E2EA8C} = {99132700-5CAD-4540-9939-7502C1A448EA}
{696D2664-D17F-4357-8A19-2B5DC4B29962} = {323AEA7C-774B-49D8-8D34-7A766288C549}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {733BCCC2-0431-4AB7-ABB6-AAE81AB54C48}
EndGlobalSection
EndGlobal
2 changes: 1 addition & 1 deletion src/Bindings/DotNet/DotNetUnmanagedApi.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<ProjectGuid>{FDC09E9D-72BB-4C74-B88B-727D9D1D6C4E}</ProjectGuid>
<RootNamespace>DotNetUnmanagedApi</RootNamespace>
<Keyword>Win32Proj</Keyword>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_VC11|Win32'" Label="Configuration">
Expand Down
32 changes: 16 additions & 16 deletions src/Bindings/Php/PhpApi.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,12 @@
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<PreBuildEvent>
<Command>..\..\..\BuildTools\WebTools\IMake\Win32\IMake.exe -p ..\MapGuideApi\Constants.xml -l PHP -o ./constants.php -t
<Command>"..\..\IMake\Win32\IMake.exe" -p "$(ProjectDir)..\MapGuideApi\Constants.xml" -l PHP -o ./constants.php -t
copy .\constants.php ..\mapadmin
copy .\constants.php ..\mapviewerphp
copy .\php.i .\language.i
..\..\..\BuildTools\WebTools\IMake\Win32\IMake.exe -p ..\MapGuideApi\MapGuideApiGen.xml -l PHP
..\..\..\Oem\SwigEx\Win32\swig -c++ -php -DWIN32 -DPHPSWIG -fcompact -baseexception MgException -clsidcode getclassid.code -clsiddata m_cls_id -catchallcode catchall.code -dispose "((MgDisposable*)arg1)-&gt;Release()" -rethrow "e-&gt;Raise()%3b" -nodefault -o MgApi_wrap.cpp -lib ..\..\..\Oem\SWIGEx\Lib MapGuideApi.i
copy .\php.i "$(ProjectDir)language.i"
"..\..\IMake\Win32\IMake.exe" -p "$(ProjectDir)..\MapGuideApi\MapGuideApiGen.xml" -l PHP
$(SWIG_TOOL_PATH)\swig -c++ -php7 -DWIN32 -DPHPSWIG -fcompact -nodefaultctor -nodefaultdtor -o MgApi_wrap.cpp MapGuideApi.i
</Command>
</PreBuildEvent>
<ClCompile>
Expand Down Expand Up @@ -128,12 +128,12 @@ copy .\php.i .\language.i
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<PreBuildEvent>
<Command>..\..\..\BuildTools\WebTools\IMake\Win64\IMake.exe -p ..\MapGuideApi\Constants.xml -l PHP -o ./constants.php -t
<Command>..\..\..\BuildTools\WebTools\IMake\Win64\IMake.exe -p "$(ProjectDir)..\MapGuideApi\Constants.xml" -l PHP -o ./constants.php -t
copy .\constants.php ..\mapadmin
copy .\constants.php ..\mapviewerphp
copy .\php.i .\language.i
..\..\..\BuildTools\WebTools\IMake\Win64\IMake.exe -p ..\MapGuideApi\MapGuideApiGen.xml -l PHP
..\..\..\Oem\SwigEx\Win32\swig -c++ -php -DWIN32 -DPHPSWIG -fcompact -baseexception MgException -clsidcode getclassid.code -clsiddata m_cls_id -catchallcode catchall.code -dispose "((MgDisposable*)arg1)-&gt;Release()" -rethrow "e-&gt;Raise()%3b" -nodefault -o MgApi_wrap.cpp -lib ..\..\..\Oem\SWIGEx\Lib MapGuideApi.i
copy .\php.i "$(ProjectDir)language.i"
..\..\..\BuildTools\WebTools\IMake\Win64\IMake.exe -p "$(ProjectDir)..\MapGuideApi\MapGuideApiGen.xml" -l PHP
$(SWIG_TOOL_PATH)\swig -c++ -php7 -DWIN32 -DPHPSWIG -fcompact -nodefaultctor -nodefaultdtor -o MgApi_wrap.cpp MapGuideApi.i
</Command>
</PreBuildEvent>
<ClCompile>
Expand Down Expand Up @@ -163,12 +163,12 @@ copy .\php.i .\language.i
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<PreBuildEvent>
<Command>..\..\..\BuildTools\WebTools\IMake\Win32\IMake.exe -p ..\MapGuideApi\Constants.xml -l PHP -o ./constants.php -t
<Command>"..\..\IMake\Win32\IMake.exe" -p "$(ProjectDir)..\MapGuideApi\Constants.xml" -l PHP -o ./constants.php -t
copy .\constants.php ..\mapadmin
copy .\constants.php ..\mapviewerphp
copy .\php.i .\language.i
..\..\..\BuildTools\WebTools\IMake\Win32\IMake.exe -p ..\MapGuideApi\MapGuideApiGen.xml -l PHP
..\..\..\Oem\SwigEx\Win32\swig -c++ -php -DWIN32 -DPHPSWIG -fcompact -baseexception MgException -clsidcode getclassid.code -clsiddata m_cls_id -catchallcode catchall.code -dispose "((MgDisposable*)arg1)-&gt;Release()" -rethrow "e-&gt;Raise()%3b" -nodefault -o MgApi_wrap.cpp -lib ..\..\..\Oem\SWIGEx\Lib MapGuideApi.i
copy .\php.i "$(ProjectDir)language.i"
"..\..\IMake\Win32\IMake.exe" -p "$(ProjectDir)..\MapGuideApi\MapGuideApiGen.xml" -l PHP
$(SWIG_TOOL_PATH)\swig -c++ -php7 -DWIN32 -DPHPSWIG -fcompact -nodefaultctor -nodefaultdtor -o MgApi_wrap.cpp MapGuideApi.i
</Command>
</PreBuildEvent>
<ClCompile>
Expand Down Expand Up @@ -199,12 +199,12 @@ copy .\php.i .\language.i
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<PreBuildEvent>
<Command>..\..\..\BuildTools\WebTools\IMake\Win64\IMake.exe -p ..\MapGuideApi\Constants.xml -l PHP -o ./constants.php -t
<Command>..\..\..\BuildTools\WebTools\IMake\Win64\IMake.exe -p "$(ProjectDir)..\MapGuideApi\Constants.xml" -l PHP -o ./constants.php -t
copy .\constants.php ..\mapadmin
copy .\constants.php ..\mapviewerphp
copy .\php.i .\language.i
..\..\..\BuildTools\WebTools\IMake\Win64\IMake.exe -p ..\MapGuideApi\MapGuideApiGen.xml -l PHP
..\..\..\Oem\SwigEx\Win32\swig -c++ -php -DWIN32 -DPHPSWIG -fcompact -baseexception MgException -clsidcode getclassid.code -clsiddata m_cls_id -catchallcode catchall.code -dispose "((MgDisposable*)arg1)-&gt;Release()" -rethrow "e-&gt;Raise()%3b" -nodefault -o MgApi_wrap.cpp -lib ..\..\..\Oem\SWIGEx\Lib MapGuideApi.i
copy .\php.i "$(ProjectDir)language.i"
..\..\..\BuildTools\WebTools\IMake\Win64\IMake.exe -p "$(ProjectDir)..\MapGuideApi\MapGuideApiGen.xml" -l PHP
$(SWIG_TOOL_PATH)\swig -c++ -php7 -DWIN32 -DPHPSWIG -fcompact -nodefaultctor -nodefaultdtor -o MgApi_wrap.cpp MapGuideApi.i
</Command>
</PreBuildEvent>
<ClCompile>
Expand Down
12 changes: 12 additions & 0 deletions src/Bindings/Php/php.i
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//

// These methods have to be invoked C-style
%ignore MgObject::GetClassId;
%ignore MgObject::GetClassName;

// SWIG is refcounting aware and since our C++ classes follow a refcounting scheme
// we can tap into this feature
//
// NOTE: We don't implement ref because anything from the native boundary is already AddRef'd
// All the managed layer should do when Disposed or GC'd is to make sure it is released
%feature("ref") MgDisposable ""
%feature("unref") MgDisposable "SAFE_RELEASE($this);"

///////////////////////////////////////////////////////////
// STRINGPARAM "in" typemap
// Marshal a string from PHP to C++
Expand Down
1 change: 1 addition & 0 deletions src/Bindings/mapadmin/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This directory is where PhpApi.vcxproj pre-build copies constants.php into
1 change: 1 addition & 0 deletions src/Bindings/mapviewerphp/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This directory is where PhpApi.vcxproj pre-build copies constants.php into

0 comments on commit efdc887

Please sign in to comment.