diff options
| author | Mateusz Adamczyk <matek_a@outlook.com> | 2016-11-06 14:55:26 +0100 |
|---|---|---|
| committer | Mateusz Adamczyk <matek_a@outlook.com> | 2016-11-07 21:42:37 +0100 |
| commit | 5dea0f41d183a89cbce8cdfed62cc80c4335566f (patch) | |
| tree | 6eff1b2ca2dc4f2e9fef0f3b88aad6179ace2af5 | |
| parent | dcb9be0b42b991b81ab46e90253cdf55f2c5d12d (diff) | |
| download | vcpkg-5dea0f41d183a89cbce8cdfed62cc80c4335566f.tar.gz vcpkg-5dea0f41d183a89cbce8cdfed62cc80c4335566f.zip | |
Added dynamic linking for windows
| -rw-r--r-- | ports/box2d/dll.patch | 410 | ||||
| -rw-r--r-- | ports/box2d/portfile.cmake | 42 |
2 files changed, 442 insertions, 10 deletions
diff --git a/ports/box2d/dll.patch b/ports/box2d/dll.patch new file mode 100644 index 000000000..dd538ae08 --- /dev/null +++ b/ports/box2d/dll.patch @@ -0,0 +1,410 @@ +From 05e359c59228183562d636d8c4559730d3674fc7 Mon Sep 17 00:00:00 2001 +From: Mateusz Adamczyk <matek_a@outlook.com> +Date: Sun, 6 Nov 2016 00:27:18 +0100 +Subject: [PATCH] Auto-create dll + +--- + Box2D/Build/vs2015/Box2D.sln | 12 +- + Box2D/Build/vs2015/Box2D.vcxproj | 24 +++ + Box2D/Build/vs2015/Box2D_dll.vcxproj | 216 +++++++++++++++++++++++++++ + Box2D/Build/vs2015/Box2D_dll.vcxproj.filters | 27 ++++ + Box2D/Build/vs2015/createDef.ps1 | 18 +++ + Box2D/Build/vs2015/main.cpp | 8 + + 6 files changed, 304 insertions(+), 1 deletion(-) + create mode 100644 Box2D/Build/vs2015/Box2D_dll.vcxproj + create mode 100644 Box2D/Build/vs2015/Box2D_dll.vcxproj.filters + create mode 100644 Box2D/Build/vs2015/createDef.ps1 + create mode 100644 Box2D/Build/vs2015/main.cpp + +diff --git a/Box2D/Build/vs2015/Box2D.sln b/Box2D/Build/vs2015/Box2D.sln +index 68a6bac..cfdd4c3 100644 +--- a/Box2D/Build/vs2015/Box2D.sln ++++ b/Box2D/Build/vs2015/Box2D.sln +@@ -1,7 +1,7 @@ + + Microsoft Visual Studio Solution File, Format Version 12.00 + # Visual Studio 14 +-VisualStudioVersion = 14.0.25123.0 ++VisualStudioVersion = 14.0.25420.1 + MinimumVisualStudioVersion = 10.0.40219.1 + Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Box2D", "Box2D.vcxproj", "{98400D17-43A5-1A40-95BE-C53AC78E7694}" + EndProject +@@ -22,6 +22,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "glew", "glew.vcxproj", "{CD + EndProject + Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "imgui", "imgui.vcxproj", "{542D8CF8-03FC-43BB-9586-D95E98150A56}" + EndProject ++Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Box2D_dll", "Box2D_dll.vcxproj", "{6CF7BCAA-8E3A-42B2-8763-5E4B63A41D84}" ++EndProject + Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 +@@ -78,6 +80,14 @@ Global + {542D8CF8-03FC-43BB-9586-D95E98150A56}.Release|Win32.Build.0 = Release|Win32 + {542D8CF8-03FC-43BB-9586-D95E98150A56}.Release|x64.ActiveCfg = Release|x64 + {542D8CF8-03FC-43BB-9586-D95E98150A56}.Release|x64.Build.0 = Release|x64 ++ {6CF7BCAA-8E3A-42B2-8763-5E4B63A41D84}.Debug|Win32.ActiveCfg = Debug|Win32 ++ {6CF7BCAA-8E3A-42B2-8763-5E4B63A41D84}.Debug|Win32.Build.0 = Debug|Win32 ++ {6CF7BCAA-8E3A-42B2-8763-5E4B63A41D84}.Debug|x64.ActiveCfg = Debug|x64 ++ {6CF7BCAA-8E3A-42B2-8763-5E4B63A41D84}.Debug|x64.Build.0 = Debug|x64 ++ {6CF7BCAA-8E3A-42B2-8763-5E4B63A41D84}.Release|Win32.ActiveCfg = Release|Win32 ++ {6CF7BCAA-8E3A-42B2-8763-5E4B63A41D84}.Release|Win32.Build.0 = Release|Win32 ++ {6CF7BCAA-8E3A-42B2-8763-5E4B63A41D84}.Release|x64.ActiveCfg = Release|x64 ++ {6CF7BCAA-8E3A-42B2-8763-5E4B63A41D84}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE +diff --git a/Box2D/Build/vs2015/Box2D.vcxproj b/Box2D/Build/vs2015/Box2D.vcxproj +index 830803c..3d86e39 100644 +--- a/Box2D/Build/vs2015/Box2D.vcxproj ++++ b/Box2D/Build/vs2015/Box2D.vcxproj +@@ -107,6 +107,12 @@ + <SubSystem>Windows</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> ++ <PostBuildEvent> ++ <Command>dumpbin /LINKERMEMBER:1 $(TargetPath) > $(TargetDir)\symbols.symb</Command> ++ </PostBuildEvent> ++ <PostBuildEvent> ++ <Message>Dumping symbols</Message> ++ </PostBuildEvent> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <ClCompile> +@@ -137,6 +143,12 @@ + <SubSystem>Windows</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> ++ <PostBuildEvent> ++ <Command>dumpbin /LINKERMEMBER:1 $(TargetPath) > $(TargetDir)\symbols.symb</Command> ++ </PostBuildEvent> ++ <PostBuildEvent> ++ <Message>Dumping symbols</Message> ++ </PostBuildEvent> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ClCompile> +@@ -168,6 +180,12 @@ + <OptimizeReferences>true</OptimizeReferences> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + </Link> ++ <PostBuildEvent> ++ <Command>dumpbin /LINKERMEMBER:1 $(TargetPath) > $(TargetDir)\symbols.symb</Command> ++ </PostBuildEvent> ++ <PostBuildEvent> ++ <Message>Dumping symbols</Message> ++ </PostBuildEvent> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <ClCompile> +@@ -202,6 +220,12 @@ + <OptimizeReferences>true</OptimizeReferences> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + </Link> ++ <PostBuildEvent> ++ <Command>dumpbin /LINKERMEMBER:1 $(TargetPath) > $(TargetDir)\symbols.symb</Command> ++ </PostBuildEvent> ++ <PostBuildEvent> ++ <Message>Dumping symbols</Message> ++ </PostBuildEvent> + </ItemDefinitionGroup> + <ItemGroup> + <ClInclude Include="..\..\Box2D\Box2D.h" /> +diff --git a/Box2D/Build/vs2015/Box2D_dll.vcxproj b/Box2D/Build/vs2015/Box2D_dll.vcxproj +new file mode 100644 +index 0000000..5c438f6 +--- /dev/null ++++ b/Box2D/Build/vs2015/Box2D_dll.vcxproj +@@ -0,0 +1,216 @@ ++<?xml version="1.0" encoding="utf-8"?> ++<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> ++ <ItemGroup Label="ProjectConfigurations"> ++ <ProjectConfiguration Include="Debug|Win32"> ++ <Configuration>Debug</Configuration> ++ <Platform>Win32</Platform> ++ </ProjectConfiguration> ++ <ProjectConfiguration Include="Release|Win32"> ++ <Configuration>Release</Configuration> ++ <Platform>Win32</Platform> ++ </ProjectConfiguration> ++ <ProjectConfiguration Include="Debug|x64"> ++ <Configuration>Debug</Configuration> ++ <Platform>x64</Platform> ++ </ProjectConfiguration> ++ <ProjectConfiguration Include="Release|x64"> ++ <Configuration>Release</Configuration> ++ <Platform>x64</Platform> ++ </ProjectConfiguration> ++ </ItemGroup> ++ <ItemGroup> ++ <None Include="createDef.ps1" /> ++ </ItemGroup> ++ <ItemGroup> ++ <ClCompile Include="main.cpp" /> ++ </ItemGroup> ++ <ItemGroup> ++ <ProjectReference Include="Box2D.vcxproj"> ++ <Project>{98400d17-43a5-1a40-95be-c53ac78e7694}</Project> ++ </ProjectReference> ++ </ItemGroup> ++ <PropertyGroup Label="Globals"> ++ <ProjectGuid>{6CF7BCAA-8E3A-42B2-8763-5E4B63A41D84}</ProjectGuid> ++ <Keyword>Win32Proj</Keyword> ++ <RootNamespace>Box2D_dll</RootNamespace> ++ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion> ++ </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> ++ </PropertyGroup> ++ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> ++ <ConfigurationType>DynamicLibrary</ConfigurationType> ++ <UseDebugLibraries>false</UseDebugLibraries> ++ <PlatformToolset>v140</PlatformToolset> ++ <WholeProgramOptimization>true</WholeProgramOptimization> ++ <CharacterSet>Unicode</CharacterSet> ++ </PropertyGroup> ++ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> ++ <ConfigurationType>DynamicLibrary</ConfigurationType> ++ <UseDebugLibraries>true</UseDebugLibraries> ++ <PlatformToolset>v140</PlatformToolset> ++ <CharacterSet>Unicode</CharacterSet> ++ </PropertyGroup> ++ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> ++ <ConfigurationType>DynamicLibrary</ConfigurationType> ++ <UseDebugLibraries>false</UseDebugLibraries> ++ <PlatformToolset>v140</PlatformToolset> ++ <WholeProgramOptimization>true</WholeProgramOptimization> ++ <CharacterSet>Unicode</CharacterSet> ++ </PropertyGroup> ++ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> ++ <ImportGroup Label="ExtensionSettings"> ++ </ImportGroup> ++ <ImportGroup Label="Shared"> ++ </ImportGroup> ++ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> ++ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> ++ </ImportGroup> ++ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> ++ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> ++ </ImportGroup> ++ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> ++ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> ++ </ImportGroup> ++ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> ++ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> ++ </ImportGroup> ++ <PropertyGroup Label="UserMacros" /> ++ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> ++ <LinkIncremental>true</LinkIncremental> ++ <OutDir>bin\dll\x$(PlatformArchitecture)\$(Configuration)\</OutDir> ++ <IntDir>obj\x$(PlatformArchitecture)\$(Configuration)\Box2D\dll\</IntDir> ++ <TargetName>Box2D</TargetName> ++ </PropertyGroup> ++ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> ++ <LinkIncremental>true</LinkIncremental> ++ <CustomBuildBeforeTargets> ++ </CustomBuildBeforeTargets> ++ <OutDir>bin\dll\x$(PlatformArchitecture)\$(Configuration)\</OutDir> ++ <IntDir>obj\x$(PlatformArchitecture)\$(Configuration)\Box2D\dll\</IntDir> ++ <TargetName>Box2D</TargetName> ++ </PropertyGroup> ++ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> ++ <LinkIncremental>false</LinkIncremental> ++ <OutDir>bin\dll\x$(PlatformArchitecture)\$(Configuration)\</OutDir> ++ <IntDir>obj\x$(PlatformArchitecture)\$(Configuration)\Box2D\dll\</IntDir> ++ <TargetName>Box2D</TargetName> ++ </PropertyGroup> ++ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> ++ <LinkIncremental>false</LinkIncremental> ++ <OutDir>bin\dll\x$(PlatformArchitecture)\$(Configuration)\</OutDir> ++ <IntDir>obj\x$(PlatformArchitecture)\$(Configuration)\Box2D\dll\</IntDir> ++ <TargetName>Box2D</TargetName> ++ </PropertyGroup> ++ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> ++ <ClCompile> ++ <PrecompiledHeader> ++ </PrecompiledHeader> ++ <WarningLevel>Level3</WarningLevel> ++ <Optimization>Disabled</Optimization> ++ <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;BOX2D_DLL_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions> ++ </ClCompile> ++ <Link> ++ <SubSystem>Windows</SubSystem> ++ <GenerateDebugInformation>true</GenerateDebugInformation> ++ <ModuleDefinitionFile>$(TargetDir)symbols.def</ModuleDefinitionFile> ++ <OutputFile>$(OutDir)Box2D$(TargetExt)</OutputFile> ++ </Link> ++ <PreBuildEvent> ++ <Command>powershell -exec bypass $(SolutionDir)createDef.ps1 -symbols $(SolutionDir)\bin\x$(PlatformArchitecture)\$(Configuration)\symbols.symb -output $(TargetDir)symbols.def</Command> ++ </PreBuildEvent> ++ <PreBuildEvent> ++ <Message>Create def file</Message> ++ </PreBuildEvent> ++ </ItemDefinitionGroup> ++ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> ++ <ClCompile> ++ <PrecompiledHeader> ++ </PrecompiledHeader> ++ <WarningLevel>Level3</WarningLevel> ++ <Optimization>Disabled</Optimization> ++ <PreprocessorDefinitions>_DEBUG;_WINDOWS;_USRDLL;BOX2D_DLL_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions> ++ </ClCompile> ++ <Link> ++ <SubSystem>Windows</SubSystem> ++ <GenerateDebugInformation>true</GenerateDebugInformation> ++ <ModuleDefinitionFile>$(TargetDir)symbols.def</ModuleDefinitionFile> ++ <OutputFile>$(OutDir)Box2D$(TargetExt)</OutputFile> ++ </Link> ++ <CustomBuildStep> ++ <Command> ++ </Command> ++ </CustomBuildStep> ++ <CustomBuildStep> ++ <Message> ++ </Message> ++ </CustomBuildStep> ++ <CustomBuildStep> ++ <Outputs> ++ </Outputs> ++ </CustomBuildStep> ++ <PreBuildEvent> ++ <Command>powershell -exec bypass $(SolutionDir)createDef.ps1 -symbols $(SolutionDir)\bin\x$(PlatformArchitecture)\$(Configuration)\symbols.symb -output $(TargetDir)symbols.def</Command> ++ </PreBuildEvent> ++ <PreBuildEvent> ++ <Message>Create def file</Message> ++ </PreBuildEvent> ++ </ItemDefinitionGroup> ++ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> ++ <ClCompile> ++ <WarningLevel>Level3</WarningLevel> ++ <PrecompiledHeader> ++ </PrecompiledHeader> ++ <Optimization>MaxSpeed</Optimization> ++ <FunctionLevelLinking>true</FunctionLevelLinking> ++ <IntrinsicFunctions>true</IntrinsicFunctions> ++ <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;BOX2D_DLL_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions> ++ </ClCompile> ++ <Link> ++ <SubSystem>Windows</SubSystem> ++ <EnableCOMDATFolding>true</EnableCOMDATFolding> ++ <OptimizeReferences>true</OptimizeReferences> ++ <GenerateDebugInformation>true</GenerateDebugInformation> ++ <ModuleDefinitionFile>$(TargetDir)symbols.def</ModuleDefinitionFile> ++ <OutputFile>$(OutDir)Box2D$(TargetExt)</OutputFile> ++ </Link> ++ <PreBuildEvent> ++ <Command>powershell -exec bypass $(SolutionDir)createDef.ps1 -symbols $(SolutionDir)\bin\x$(PlatformArchitecture)\$(Configuration)\symbols.symb -output $(TargetDir)symbols.def</Command> ++ </PreBuildEvent> ++ <PreBuildEvent> ++ <Message>Create def file</Message> ++ </PreBuildEvent> ++ </ItemDefinitionGroup> ++ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> ++ <ClCompile> ++ <WarningLevel>Level3</WarningLevel> ++ <PrecompiledHeader> ++ </PrecompiledHeader> ++ <Optimization>MaxSpeed</Optimization> ++ <FunctionLevelLinking>true</FunctionLevelLinking> ++ <IntrinsicFunctions>true</IntrinsicFunctions> ++ <PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;BOX2D_DLL_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions> ++ </ClCompile> ++ <Link> ++ <SubSystem>Windows</SubSystem> ++ <EnableCOMDATFolding>true</EnableCOMDATFolding> ++ <OptimizeReferences>true</OptimizeReferences> ++ <GenerateDebugInformation>true</GenerateDebugInformation> ++ <ModuleDefinitionFile>$(TargetDir)symbols.def</ModuleDefinitionFile> ++ <OutputFile>$(OutDir)Box2D$(TargetExt)</OutputFile> ++ </Link> ++ <PreBuildEvent> ++ <Command>powershell -exec bypass $(SolutionDir)createDef.ps1 -symbols $(SolutionDir)\bin\x$(PlatformArchitecture)\$(Configuration)\symbols.symb -output $(TargetDir)symbols.def</Command> ++ </PreBuildEvent> ++ <PreBuildEvent> ++ <Message>Create def file</Message> ++ </PreBuildEvent> ++ </ItemDefinitionGroup> ++ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> ++ <ImportGroup Label="ExtensionTargets"> ++ </ImportGroup> ++</Project> +\ No newline at end of file +diff --git a/Box2D/Build/vs2015/Box2D_dll.vcxproj.filters b/Box2D/Build/vs2015/Box2D_dll.vcxproj.filters +new file mode 100644 +index 0000000..6e1dfcb +--- /dev/null ++++ b/Box2D/Build/vs2015/Box2D_dll.vcxproj.filters +@@ -0,0 +1,27 @@ ++<?xml version="1.0" encoding="utf-8"?> ++<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> ++ <ItemGroup> ++ <Filter Include="Source Files"> ++ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> ++ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> ++ </Filter> ++ <Filter Include="Header Files"> ++ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> ++ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions> ++ </Filter> ++ <Filter Include="Resource Files"> ++ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier> ++ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions> ++ </Filter> ++ </ItemGroup> ++ <ItemGroup> ++ <None Include="createDef.ps1"> ++ <Filter>Source Files</Filter> ++ </None> ++ </ItemGroup> ++ <ItemGroup> ++ <ClCompile Include="main.cpp"> ++ <Filter>Source Files</Filter> ++ </ClCompile> ++ </ItemGroup> ++</Project> +\ No newline at end of file +diff --git a/Box2D/Build/vs2015/createDef.ps1 b/Box2D/Build/vs2015/createDef.ps1 +new file mode 100644 +index 0000000..4939723 +--- /dev/null ++++ b/Box2D/Build/vs2015/createDef.ps1 +@@ -0,0 +1,18 @@ ++param( ++ [String] $symbols, ++ [String] $output ++) ++ ++Write-Output "LIBRARY Box2D" > $output ++Write-Output 'DESCRIPTION "Box2D dynamic link library"' >> $output ++Write-Output "EXPORTS" >> $output ++ ++$from = (Select-String $symbols -pattern "public symbols" | Select-Object LineNumber).LineNumber + 1 ++$to = (Select-String $symbols -pattern "Summary" | Select-Object LineNumber).LineNumber - 2 ++$no = 1 ++Get-Content $symbols -head $to ` ++ | Select-Object -Last ($to - $from) ` ++ | ForEach-Object { Write-Output $_.split()[-1] } ` ++ | Select-String -Pattern '^\?' ` ++ | ForEach-Object { Write-Output ("`t" + $_ + " @" + $no++) } ` ++ >> $output +\ No newline at end of file +diff --git a/Box2D/Build/vs2015/main.cpp b/Box2D/Build/vs2015/main.cpp +new file mode 100644 +index 0000000..72216f9 +--- /dev/null ++++ b/Box2D/Build/vs2015/main.cpp +@@ -0,0 +1,8 @@ ++#define WIN32_LEAN_AND_MEAN ++#include <Windows.h> ++ ++BOOL APIENTRY DllMain(HANDLE hModule, ++ DWORD ul_reason_for_call, ++ LPVOID lpReserved) { ++ return TRUE; ++} +-- +2.10.2.windows.1 + diff --git a/ports/box2d/portfile.cmake b/ports/box2d/portfile.cmake index e70c373eb..59d7c119e 100644 --- a/ports/box2d/portfile.cmake +++ b/ports/box2d/portfile.cmake @@ -1,12 +1,11 @@ include(${CMAKE_TRIPLET_FILE}) -if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - message(FATAL_ERROR "Dynamic building not supported") -endif() # Get architecture params set(PROJECT_ARCH "x64") +set(PROJECT_ARCH_BITS "${PROJECT_ARCH}") if(TRIPLET_SYSTEM_ARCH MATCHES "x86") set(PROJECT_ARCH "Win32") + set(PROJECT_ARCH_BITS "x32") endif(TRIPLET_SYSTEM_ARCH MATCHES "x86") include(vcpkg_common_functions) @@ -38,6 +37,11 @@ message(STATUS "Adding worktree done") set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/) +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES "${CMAKE_CURRENT_LIST_DIR}/dll.patch" +) + # Put the licence and readme files where vcpkg expects it message(STATUS "Packaging license") file(COPY ${SOURCE_PATH}/README.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/box2d) @@ -46,32 +50,50 @@ file(RENAME ${CURRENT_PACKAGES_DIR}/share/box2d/License.txt ${CURRENT_PACKAGES_D message(STATUS "Packaging license done") # Building: +set(PROJECT "./Box2D/Build/vs2015/Box2D.vcxproj") +set(OUTPUTS_PATH "${SOURCE_PATH}/Box2D/Build/vs2015/bin/${PROJECT_ARCH_BITS}") +if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + set(PROJECT "./Box2D/Build/vs2015/Box2D_dll.vcxproj") + set(OUTPUTS_PATH "${SOURCE_PATH}/Box2D/Build/vs2015/bin/dll/${PROJECT_ARCH_BITS}") +endif(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + foreach(TYPE "Release" "Debug") message(STATUS "Building ${TARGET_TRIPLET}-${TYPE}") vcpkg_execute_required_process( COMMAND "devenv.exe" "./Box2D/Build/vs2015/Box2D.sln" /Build "${TYPE}|${PROJECT_ARCH}" - /Project "./Box2D/Build/vs2015/Box2D.vcxproj" + /Project "${PROJECT}" /Projectconfig "${TYPE}|${PROJECT_ARCH}" WORKING_DIRECTORY ${SOURCE_PATH} LOGNAME build-${TARGET_TRIPLET}-${TYPE} ) message(STATUS "Building ${TARGET_TRIPLET}-${TYPE} done") - message(STATUS "Packaging ${TARGET_TRIPLET}-${TYPE} lib") - set(TARGET_PATH "${CURRENT_PACKAGES_DIR}/lib") + set(TARGET_PATH "${CURRENT_PACKAGES_DIR}") if(TYPE STREQUAL Debug) - set(TARGET_PATH "${CURRENT_PACKAGES_DIR}/debug/lib") + set(TARGET_PATH "${CURRENT_PACKAGES_DIR}/debug") endif(TYPE STREQUAL Debug) + message(STATUS "Packaging ${TARGET_TRIPLET}-${TYPE} lib") file( - INSTALL ${SOURCE_PATH}/Box2D/Build/vs2015/bin/${PROJECT_ARCH}/${TYPE}/ - DESTINATION ${TARGET_PATH} + INSTALL ${OUTPUTS_PATH}/${TYPE}/ + DESTINATION ${TARGET_PATH}/lib FILES_MATCHING PATTERN "*.lib" ) - file(RENAME ${TARGET_PATH}/Box2D.lib ${TARGET_PATH}/box2d.lib) + file(RENAME ${TARGET_PATH}/lib/Box2D.lib ${TARGET_PATH}/lib/box2d.lib) message(STATUS "Packaging ${TARGET_TRIPLET}-${TYPE} lib done") + + if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + message(STATUS "Packaging ${TARGET_TRIPLET}-${TYPE} dll") + file( + INSTALL ${OUTPUTS_PATH}/${TYPE}/ + DESTINATION ${TARGET_PATH}/bin + FILES_MATCHING PATTERN "*.dll" + ) + file(RENAME ${TARGET_PATH}/bin/Box2D.dll ${TARGET_PATH}/bin/box2d.dll) + message(STATUS "Packaging ${TARGET_TRIPLET}-${TYPE} dll done") + endif(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) endforeach() message(STATUS "Packaging headers") |
