From 2588311215b3e9b49c695369941698f333f52fe9 Mon Sep 17 00:00:00 2001 From: Mansoor Saqib Date: Wed, 14 Apr 2021 22:53:31 -0700 Subject: [PATCH] Fix silent fallback to Debug when building native libs (#51210) * Currently the CMAKE_BUILD_TYPE is not being passed in when creating the native library intermediates. * Before the change to Ninja for CMake generation (8c2158f9fe1) the default uninitialized cmake build type was set to Release so the bug was not visible. * After the Ninja change, the default uninitialized cmake build type is set to Debug so it becomes more apparent. * This improves performance of native libs like System.IO.Compression by a considerable amount as they are currently being built in Debug, even when the Release configuration is specified. --- src/libraries/Native/build-native.cmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/Native/build-native.cmd b/src/libraries/Native/build-native.cmd index b6c19847989a6..c9c3216e5d717 100644 --- a/src/libraries/Native/build-native.cmd +++ b/src/libraries/Native/build-native.cmd @@ -52,10 +52,10 @@ echo. :: cmake requires forward slashes in paths set __cmakeRepoRoot=%__repoRoot:\=/% set __ExtraCmakeParams="-DCMAKE_REPO_ROOT=%__cmakeRepoRoot%" +set __ExtraCmakeParams=%__ExtraCmakeParams% "-DCMAKE_BUILD_TYPE=%CMAKE_BUILD_TYPE%" if /i "%__BuildArch%" == "wasm" ( set __sourceDir=%~dp0\Unix - set __ExtraCmakeParams=%__ExtraCmakeParams% "-DCMAKE_BUILD_TYPE=%CMAKE_BUILD_TYPE%" ) if [%__outConfig%] == [] set __outConfig=%__TargetOS%-%__BuildArch%-%CMAKE_BUILD_TYPE%