Fix Win compile and add init.ps1 example

This commit is contained in:
Marko Budiselic 2023-04-08 14:57:12 +02:00
parent fb3029f33d
commit 94428bc56f
2 changed files with 13 additions and 1 deletions

12
init.ps1 Normal file
View File

@ -0,0 +1,12 @@
# TODO(gitbuda): All paths compiler paths are hardcoded -> CMake will handle.
$compiler="C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.30.30705\bin\Hostx64\x64\cl"
$stdlibinclude="C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.30.30705\include"
$toolsinclude="C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt"
$uminclude="C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um"
$sharedinclude="C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared"
$stdlib="C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.30.30705\lib\x64"
$umlib="C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\um\x64"
$ucrtlib="C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\ucrt\x64"
& $compiler -I"$stdlibinclude" -I"$toolsinclude" -I"$uminclude" -I"$sharedinclude" -I"src" /std:c++20 /EHsc tests\manual\shared_library_handle.cpp /link /LIBPATH:"$stdlib" /LIBPATH:"$umlib" /LIBPATH:"$ucrtlib"

View File

@ -27,7 +27,7 @@ int main(int argc, char *argv[]) {
LinuxDLHandle handle("test", 0);
#elif defined(_WIN32)
std::cout << "Windows" << std::endl;
WindowsDLLHandle handle("test", 0);
WindowsDLLHandle handle;
#else
std::cout << "Unsupportd platform" << std::endl;
#endif