cmake: add option for pollyhedral optimization.

This commit is contained in:
Andrey Akhmichin 2024-01-12 14:02:25 +05:00
parent d57b3fade7
commit 30c1a9fb57
1 changed files with 9 additions and 0 deletions

View File

@ -46,6 +46,7 @@ option(USE_NOVGUI_SCOREBOARD "Prefer non-VGUI Scoreboard when USE_VGUI is enable
option(USE_VOICEMGR "Enable VOICE MANAGER." OFF)
option(BUILD_CLIENT "Build client dll" ON)
option(BUILD_SERVER "Build server dll" ON)
option(POLLY "Enable pollyhedral optimization" OFF)
if(CMAKE_SIZEOF_VOID_P EQUAL 4 OR
((WIN32 OR ${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
@ -177,3 +178,11 @@ endif()
if(NOT BUILD_SERVER AND NOT BUILD_CLIENT)
message(FATAL_ERROR "Nothing to build")
endif()
if(POLLY)
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
add_compile_options(-mllvm -polly)
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
add_compile_options(-fgraphite-identity -floop-interchange -floop-block)
endif()
endif()