diff --git a/CMakeLists.txt b/CMakeLists.txt index edfc61bcc..ae8130289 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,9 +30,19 @@ function(configure_msvc_target target) $<$:/EHsc> $<$:/GR> $<$,$>:/Od> - $<$,$>:/GL /O2 /Oi /GT /GF /Ob3> + $<$,$>:/GL /O2 /Oi /GT /GF> ) endfunction() +function(configure_clang_target target) + target_compile_options(${target} PRIVATE + $<$,$>:-O0 -Wall> + $<$,$>:-O2 -w -flto> + ) + target_link_options(${target} PRIVATE + $<$:-flto> + ) +endfunction() + # --- # Configuration diff --git a/Minecraft.Client/CMakeLists.txt b/Minecraft.Client/CMakeLists.txt index 4e4116190..1724f4a2c 100644 --- a/Minecraft.Client/CMakeLists.txt +++ b/Minecraft.Client/CMakeLists.txt @@ -45,6 +45,9 @@ if(MSVC) $<$:/LTCG:incremental> ) endif() +if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + configure_clang_target(Minecraft.Client) +endif() set_target_properties(Minecraft.Client PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/$" diff --git a/Minecraft.World/CMakeLists.txt b/Minecraft.World/CMakeLists.txt index caf6d0bf2..24cf7f9bd 100644 --- a/Minecraft.World/CMakeLists.txt +++ b/Minecraft.World/CMakeLists.txt @@ -29,3 +29,6 @@ target_precompile_headers(Minecraft.World PRIVATE "$<$:std if(MSVC) configure_msvc_target(Minecraft.World) endif() +if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + configure_clang_target(Minecraft.World) +endif()