From 33eb8101a25d41b9a19bdad45d109e55e0aa7ee2 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 27 Oct 2018 18:21:15 +0200 Subject: Add more include paths for msvc --- backend/ninja/Ninja.cpp | 3 ++- msvc/locate_windows_sdk.exe | Bin 19968 -> 19968 bytes msvc/locate_windows_sdk/locate_sdk.cpp | 2 ++ msvc/locate_windows_sdk/locate_sdk.hpp | 1 + msvc/locate_windows_sdk/main.cpp | Bin 2304 -> 2402 bytes msvc/sibs.exe | Bin 404480 -> 404480 bytes src/main.cpp | 9 ++++++--- 7 files changed, 11 insertions(+), 4 deletions(-) diff --git a/backend/ninja/Ninja.cpp b/backend/ninja/Ninja.cpp index e332bd7..0ba08ab 100644 --- a/backend/ninja/Ninja.cpp +++ b/backend/ninja/Ninja.cpp @@ -1071,7 +1071,8 @@ namespace backend ninja::NinjaArg::createRaw("/c"), ninja::NinjaArg::createRaw("$in"), ninja::NinjaArg::createRaw("/Fo$out"), - ninja::NinjaArg::createRaw("$globalIncDir") + ninja::NinjaArg::createRaw("$globalIncDir"), + ninja::NinjaArg::createRaw("/FS") }); compileCCommand.insert(compileCCommand.end(), cflags.begin(), cflags.end()); diff --git a/msvc/locate_windows_sdk.exe b/msvc/locate_windows_sdk.exe index 10ad369..cae8f12 100644 Binary files a/msvc/locate_windows_sdk.exe and b/msvc/locate_windows_sdk.exe differ diff --git a/msvc/locate_windows_sdk/locate_sdk.cpp b/msvc/locate_windows_sdk/locate_sdk.cpp index a79d032..3ac0787 100644 --- a/msvc/locate_windows_sdk/locate_sdk.cpp +++ b/msvc/locate_windows_sdk/locate_sdk.cpp @@ -536,6 +536,7 @@ Find_Result find_visual_studio_and_windows_sdk(SdkArch sdkArch) { if (result.windows_include_root) { result.windows_include_um_path = concat(result.windows_include_root, L"\\um"); result.windows_include_ucrt_path = concat(result.windows_include_root, L"\\ucrt"); + result.windows_include_shared_path = concat(result.windows_include_root, L"\\shared"); } find_visual_studio_by_fighting_through_microsoft_craziness(&result); @@ -550,6 +551,7 @@ void free_resources(Find_Result *result) { free(result->windows_include_root); free(result->windows_include_um_path); free(result->windows_include_ucrt_path); + free(result->windows_include_shared_path); free(result->vs_exe_path); free(result->vs_library_path); free(result->vs_include_path); diff --git a/msvc/locate_windows_sdk/locate_sdk.hpp b/msvc/locate_windows_sdk/locate_sdk.hpp index 49e0dd4..4c70902 100644 --- a/msvc/locate_windows_sdk/locate_sdk.hpp +++ b/msvc/locate_windows_sdk/locate_sdk.hpp @@ -13,6 +13,7 @@ struct Find_Result { wchar_t *windows_include_root = NULL; wchar_t *windows_include_um_path = NULL; wchar_t *windows_include_ucrt_path = NULL; + wchar_t *windows_include_shared_path = NULL; wchar_t *vs_exe_path = NULL; wchar_t *vs_library_path = NULL; diff --git a/msvc/locate_windows_sdk/main.cpp b/msvc/locate_windows_sdk/main.cpp index 7fb5657..a507d6d 100644 Binary files a/msvc/locate_windows_sdk/main.cpp and b/msvc/locate_windows_sdk/main.cpp differ diff --git a/msvc/sibs.exe b/msvc/sibs.exe index 51aad1b..b41ae6d 100644 Binary files a/msvc/sibs.exe and b/msvc/sibs.exe differ diff --git a/src/main.cpp b/src/main.cpp index a295eba..1265d3d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -300,6 +300,8 @@ struct MicrosoftBuildTool char umIncludePath[_TINYDIR_PATH_MAX]; // empty if not found char ucrtIncludePath[_TINYDIR_PATH_MAX]; + // empty if not found + char sharedIncludePath[_TINYDIR_PATH_MAX]; bool found() { @@ -314,7 +316,7 @@ static MicrosoftBuildTool locateLatestMicrosoftBuildTool() if (execResult && execResult.unwrap().exitCode == 0) { auto &str = execResult.unwrap().execStdout; - sscanf(execResult.unwrap().execStdout.c_str(), "%d %[^\r\n] %[^\r\n] %[^\r\n] %[^\r\n] %[^\r\n] %[^\r\n] %[^\r\n]", + sscanf(execResult.unwrap().execStdout.c_str(), "%d %[^\r\n] %[^\r\n] %[^\r\n] %[^\r\n] %[^\r\n] %[^\r\n] %[^\r\n] %[^\r\n]", &result.version, result.binPath, result.vsLibPath, @@ -322,7 +324,8 @@ static MicrosoftBuildTool locateLatestMicrosoftBuildTool() result.ucrtLibPath, result.vsIncludePath, result.umIncludePath, - result.ucrtIncludePath); + result.ucrtIncludePath, + result.sharedIncludePath); } return result; } @@ -341,7 +344,7 @@ static void appendMicrosoftBuildToolToPathEnv() fprintf(stderr, "Warning: Failed to add microsoft build tools to PATH env\n"); } - if (_putenv_s("INCLUDE", join({ msBuildTool.vsIncludePath, msBuildTool.umIncludePath, msBuildTool.ucrtIncludePath }, ';')) != 0) + if (_putenv_s("INCLUDE", join({ msBuildTool.vsIncludePath, msBuildTool.umIncludePath, msBuildTool.ucrtIncludePath, msBuildTool.sharedIncludePath }, ';')) != 0) fprintf(stderr, "Warning: Failed to add microsoft build libraries to INCLUDE env\n"); if (_putenv_s("LIB", join({ msBuildTool.vsLibPath, msBuildTool.umLibPath, msBuildTool.ucrtLibPath }, ';')) != 0) -- cgit v1.2.3