mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
add option to enable link time optimization
a bit slower to compile for developing so defaults to 'false', but might be a good idea for the releases.
This commit is contained in:
committed by
majcosta
parent
dc72a43a19
commit
a83dfbefb0
@@ -9,6 +9,14 @@ set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
|
||||
include(CheckIPOSupported)
|
||||
check_ipo_supported(RESULT LinkTimeOptimization OUTPUT IpoError LANGUAGES C CXX)
|
||||
if(LinkTimeOptimization)
|
||||
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
|
||||
else()
|
||||
message(WARNING "IPO is not supported: ${IpoError}")
|
||||
endif()
|
||||
|
||||
option(ADDRESS_SANITIZER OFF)
|
||||
if(ADDRESS_SANITIZER)
|
||||
message(STATUS "AddressSanitizer ENABLED for non-Release builds")
|
||||
|
||||
Reference in New Issue
Block a user