Merge pull request 'Cmake IPO' (#196) from cmake_stuff into master

Reviewed-on: https://git.madvoxel.net/OpenVulkano/OpenVulkano/pulls/196
Reviewed-by: Georg Hagen <georg.hagen@madvoxel.com>
This commit is contained in:
Oleksii_Hyzha
2025-01-28 15:25:53 +01:00

View File

@@ -1,10 +1,12 @@
include(CheckIPOSupported)
function(SetOptimisationSettings)
check_ipo_supported(RESULT result)
if(result)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE PARENT_SCOPE)
endif ()
if (NOT CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
check_ipo_supported(RESULT result)
if(result)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE PARENT_SCOPE)
endif()
endif()
if (LINUX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native -mtune=native" PARENT_SCOPE)
@@ -22,8 +24,7 @@ function(SetWarningSettings TARGET)
elseif (WIN32)
if (MSVC)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
add_compile_options(/wd4068)
set_target_properties(${TARGET} PROPERTIES COMPILE_FLAGS "/wd4068")
target_compile_options(${TARGET} PRIVATE "/wd4068;")
set_target_properties(${TARGET} PROPERTIES COMPILE_FLAGS "/we4715")
set_target_properties(${TARGET} PROPERTIES LINK_FLAGS "/ignore:4099")
endif()