Fix Linux compilation flags (dotnet/coreclr#25801)
authorBruce Forstall <brucefo@microsoft.com>
Sat, 20 Jul 2019 15:58:18 +0000 (08:58 -0700)
committerGitHub <noreply@github.com>
Sat, 20 Jul 2019 15:58:18 +0000 (08:58 -0700)
commit6ffdc25dc6b3f9db00cae8b5496701475c53ce56
tree7fe198d91c214aa2b6dc700d7e96431ef5097e0e
parent34034e1db054067ba607bf6123a3ee5ffb6e5b01
Fix Linux compilation flags (dotnet/coreclr#25801)

`configureoptimization.cmake` was being included before `CLR_CMAKE_PLATFORM_UNIX`
was set, though it depends on that variable to set Linux optimization
flags. Move the include lower, after `CLR_CMAKE_PLATFORM_UNIX` is set.

This leads to Debug builds being built with `-O0` and Checked builds built
with `-O2`, instead of the default due to no `-O` flag being passed. Release
is still built `-O3`; somehow, it was being built that way already.

Fixes dotnet/coreclr#25273 (Although Alpine will still see a stack overflow in the failing
test case with Debug builds, it won't affect Checked build CI runs, which is
the primary flavor tested in coreclr CI.)

Commit migrated from https://github.com/dotnet/coreclr/commit/500430f40b3420615b67998f003fbf57ad8f5234
src/coreclr/configurecompiler.cmake