From e7d7b09db7a697f41fc2608401c99f738e27ca60 Mon Sep 17 00:00:00 2001 From: jie Date: Tue, 2 Nov 2021 20:40:16 +0800 Subject: [PATCH] update examples for windows --- README.md | 2 +- WebApp/bserv/include/bserv/router.hpp | 1 + examples/Examples.sln | 57 ++++++++++ examples/Hello.vcxproj | 154 ++++++++++++++++++++++++++ examples/Hello.vcxproj.filters | 22 ++++ examples/Hello.vcxproj.user | 4 + examples/Routing.vcxproj | 154 ++++++++++++++++++++++++++ examples/Routing.vcxproj.filters | 22 ++++ examples/Routing.vcxproj.user | 4 + 9 files changed, 419 insertions(+), 1 deletion(-) create mode 100644 examples/Examples.sln create mode 100644 examples/Hello.vcxproj create mode 100644 examples/Hello.vcxproj.filters create mode 100644 examples/Hello.vcxproj.user create mode 100644 examples/Routing.vcxproj create mode 100644 examples/Routing.vcxproj.filters create mode 100644 examples/Routing.vcxproj.user diff --git a/README.md b/README.md index dd8a040..c55380f 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ ## Quick Start -> [`examples/CMakeLists.txt`](examples/CMakeLists.txt) can be used to compile all the examples. +> In Windows, you can simply open [`examples/Examples.sln`](examples/Examples.sln). In Ubuntu, [`examples/CMakeLists.txt`](examples/CMakeLists.txt) can be used to compile all the examples. ### Hello, World! diff --git a/WebApp/bserv/include/bserv/router.hpp b/WebApp/bserv/include/bserv/router.hpp index 566bc15..e4ca12e 100644 --- a/WebApp/bserv/include/bserv/router.hpp +++ b/WebApp/bserv/include/bserv/router.hpp @@ -266,6 +266,7 @@ namespace bserv { Ret(*pf)(Args ...), parameter_pack& params) { // suppress msvc warning boost::ignore_unused(params); + boost::ignore_unused(resources); if constexpr (Idx == 0) return (*pf)(); else return static_cast, diff --git a/examples/Examples.sln b/examples/Examples.sln new file mode 100644 index 0000000..261d436 --- /dev/null +++ b/examples/Examples.sln @@ -0,0 +1,57 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31729.503 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Hello", "Hello.vcxproj", "{1BAC7984-10C0-47E8-8F8D-B6CF74810013}" + ProjectSection(ProjectDependencies) = postProject + {F5C0CF6D-7BF9-40A5-AF2E-8FC36A1D7296} = {F5C0CF6D-7BF9-40A5-AF2E-8FC36A1D7296} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bserv", "..\WebApp\bserv\bserv.vcxproj", "{F5C0CF6D-7BF9-40A5-AF2E-8FC36A1D7296}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Routing", "Routing.vcxproj", "{9AAF3E12-6588-46C1-BD36-EAAC463C5259}" + ProjectSection(ProjectDependencies) = postProject + {F5C0CF6D-7BF9-40A5-AF2E-8FC36A1D7296} = {F5C0CF6D-7BF9-40A5-AF2E-8FC36A1D7296} + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {1BAC7984-10C0-47E8-8F8D-B6CF74810013}.Debug|x64.ActiveCfg = Debug|x64 + {1BAC7984-10C0-47E8-8F8D-B6CF74810013}.Debug|x64.Build.0 = Debug|x64 + {1BAC7984-10C0-47E8-8F8D-B6CF74810013}.Debug|x86.ActiveCfg = Debug|Win32 + {1BAC7984-10C0-47E8-8F8D-B6CF74810013}.Debug|x86.Build.0 = Debug|Win32 + {1BAC7984-10C0-47E8-8F8D-B6CF74810013}.Release|x64.ActiveCfg = Release|x64 + {1BAC7984-10C0-47E8-8F8D-B6CF74810013}.Release|x64.Build.0 = Release|x64 + {1BAC7984-10C0-47E8-8F8D-B6CF74810013}.Release|x86.ActiveCfg = Release|Win32 + {1BAC7984-10C0-47E8-8F8D-B6CF74810013}.Release|x86.Build.0 = Release|Win32 + {F5C0CF6D-7BF9-40A5-AF2E-8FC36A1D7296}.Debug|x64.ActiveCfg = Debug|x64 + {F5C0CF6D-7BF9-40A5-AF2E-8FC36A1D7296}.Debug|x64.Build.0 = Debug|x64 + {F5C0CF6D-7BF9-40A5-AF2E-8FC36A1D7296}.Debug|x86.ActiveCfg = Debug|Win32 + {F5C0CF6D-7BF9-40A5-AF2E-8FC36A1D7296}.Debug|x86.Build.0 = Debug|Win32 + {F5C0CF6D-7BF9-40A5-AF2E-8FC36A1D7296}.Release|x64.ActiveCfg = Release|x64 + {F5C0CF6D-7BF9-40A5-AF2E-8FC36A1D7296}.Release|x64.Build.0 = Release|x64 + {F5C0CF6D-7BF9-40A5-AF2E-8FC36A1D7296}.Release|x86.ActiveCfg = Release|Win32 + {F5C0CF6D-7BF9-40A5-AF2E-8FC36A1D7296}.Release|x86.Build.0 = Release|Win32 + {9AAF3E12-6588-46C1-BD36-EAAC463C5259}.Debug|x64.ActiveCfg = Debug|x64 + {9AAF3E12-6588-46C1-BD36-EAAC463C5259}.Debug|x64.Build.0 = Debug|x64 + {9AAF3E12-6588-46C1-BD36-EAAC463C5259}.Debug|x86.ActiveCfg = Debug|Win32 + {9AAF3E12-6588-46C1-BD36-EAAC463C5259}.Debug|x86.Build.0 = Debug|Win32 + {9AAF3E12-6588-46C1-BD36-EAAC463C5259}.Release|x64.ActiveCfg = Release|x64 + {9AAF3E12-6588-46C1-BD36-EAAC463C5259}.Release|x64.Build.0 = Release|x64 + {9AAF3E12-6588-46C1-BD36-EAAC463C5259}.Release|x86.ActiveCfg = Release|Win32 + {9AAF3E12-6588-46C1-BD36-EAAC463C5259}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {DD093C1B-8288-48B1-9C6D-2E36455900D8} + EndGlobalSection +EndGlobal diff --git a/examples/Hello.vcxproj b/examples/Hello.vcxproj new file mode 100644 index 0000000..fbc4149 --- /dev/null +++ b/examples/Hello.vcxproj @@ -0,0 +1,154 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + + + + 16.0 + Win32Proj + {1bac7984-10c0-47e8-8f8d-b6cf74810013} + Hello + 10.0 + + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + false + + + true + + + false + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + ..\dependencies\libpqxx\include;..\dependencies;..\dependencies\boost;..\WebApp\bserv\include;%(AdditionalIncludeDirectories) + stdcpp17 + + + Console + true + bserv.lib;cryptlib.lib;pqxx.lib;libpq.lib;wsock32.lib;ws2_32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;comdlg32.lib;advapi32.lib;%(AdditionalDependencies) + ..\dependencies\libpqxx\src\Debug;..\dependencies\pgsql\lib;..\dependencies\cryptopp\x64\Output\Debug;..\dependencies\boost\stage\lib;$(OutDir);%(AdditionalLibraryDirectories) + + + xcopy /y /d "..\dependencies\pgsql\bin\*.dll" "$(OutDir)" + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + \ No newline at end of file diff --git a/examples/Hello.vcxproj.filters b/examples/Hello.vcxproj.filters new file mode 100644 index 0000000..b3174fa --- /dev/null +++ b/examples/Hello.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + 源文件 + + + \ No newline at end of file diff --git a/examples/Hello.vcxproj.user b/examples/Hello.vcxproj.user new file mode 100644 index 0000000..88a5509 --- /dev/null +++ b/examples/Hello.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/examples/Routing.vcxproj b/examples/Routing.vcxproj new file mode 100644 index 0000000..93a7195 --- /dev/null +++ b/examples/Routing.vcxproj @@ -0,0 +1,154 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + + + + 16.0 + Win32Proj + {9aaf3e12-6588-46c1-bd36-eaac463c5259} + Routing + 10.0 + + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + false + + + true + + + false + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + stdcpp17 + ..\dependencies\libpqxx\include;..\dependencies;..\dependencies\boost;..\WebApp\bserv\include;%(AdditionalIncludeDirectories) + + + Console + true + ..\dependencies\libpqxx\src\Debug;..\dependencies\pgsql\lib;..\dependencies\cryptopp\x64\Output\Debug;..\dependencies\boost\stage\lib;$(OutDir);%(AdditionalLibraryDirectories) + bserv.lib;cryptlib.lib;pqxx.lib;libpq.lib;wsock32.lib;ws2_32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;comdlg32.lib;advapi32.lib;%(AdditionalDependencies) + + + xcopy /y /d "..\dependencies\pgsql\bin\*.dll" "$(OutDir)" + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + \ No newline at end of file diff --git a/examples/Routing.vcxproj.filters b/examples/Routing.vcxproj.filters new file mode 100644 index 0000000..a37d008 --- /dev/null +++ b/examples/Routing.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + 源文件 + + + \ No newline at end of file diff --git a/examples/Routing.vcxproj.user b/examples/Routing.vcxproj.user new file mode 100644 index 0000000..88a5509 --- /dev/null +++ b/examples/Routing.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file