mirror of
https://github.com/BepInEx/dotnet-runtime.git
synced 2026-11-22 19:10:41 -10:00
That is, optimize for speed, not for size. Don't do this for Windows x86, due to https://github.com/dotnet/runtime/issues/59845
18 lines
927 B
CMake
18 lines
927 B
CMake
if(CLR_CMAKE_HOST_WIN32)
|
|
add_compile_options($<$<AND:$<COMPILE_LANGUAGE:C,CXX>,$<CONFIG:Debug>>:/Od>)
|
|
if (CLR_CMAKE_HOST_ARCH_I386)
|
|
# The Windows x86 Checked CLR has some kind of problem with exception handling
|
|
# when compiled with /O2. Issue: https://github.com/dotnet/runtime/issues/59845.
|
|
add_compile_options($<$<AND:$<COMPILE_LANGUAGE:C,CXX>,$<CONFIG:Checked>>:/O1>)
|
|
else()
|
|
add_compile_options($<$<AND:$<COMPILE_LANGUAGE:C,CXX>,$<CONFIG:Checked>>:/O2>)
|
|
endif()
|
|
add_compile_options($<$<AND:$<COMPILE_LANGUAGE:C,CXX>,$<CONFIG:Release>>:/Ox>)
|
|
add_compile_options($<$<AND:$<COMPILE_LANGUAGE:C,CXX>,$<CONFIG:RelWithDebInfo>>:/O2>)
|
|
elseif(CLR_CMAKE_HOST_UNIX)
|
|
add_compile_options($<$<CONFIG:Debug>:-O0>)
|
|
add_compile_options($<$<CONFIG:Checked>:-O2>)
|
|
add_compile_options($<$<CONFIG:Release>:-O3>)
|
|
add_compile_options($<$<CONFIG:RelWithDebInfo>:-O2>)
|
|
endif()
|