Skip to content

Commit

Permalink
Fix silent fallback to Debug when building native libs (#51210)
Browse files Browse the repository at this point in the history
* Currently the CMAKE_BUILD_TYPE is not being passed in when
  creating the native library intermediates.
* Before the change to Ninja for CMake generation (8c2158f)
  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.
  • Loading branch information
L2 committed Apr 15, 2021
1 parent b482c04 commit 2588311
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libraries/Native/build-native.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -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%
Expand Down

0 comments on commit 2588311

Please sign in to comment.