[Tarantool-patches] [PATCH] cmake: add LTO support for building luajit

Alexander Turenko alexander.turenko at tarantool.org
Tue Jun 16 20:34:02 MSK 2020


> +    # Enablibg LTO for luajit if DENABLE_LTO set.
> +    if (${ENABLE_LTO})
> +`......message(STATUS "Enablig LTO for luajit")
> +        set (luajit_ld ${CMAKE_C_LINK_OPTIONS_IPO})
> +`......set (luajit_cflags ${luajit_cflags} ${CFLAGS_LTO})
> +`......set (CMAKE_AR ${AR_LTO})
> endif()

It seems I forgot to mention one point in the previous message.

Please, set luajit_ar variable and use it below, not reassign CMAKE_AR.
`include(luajit)` directive does not open a new variables scope, so if
we'll reassign CMAKE_AR here, it may affect static libraries creation
for code outside luajit. We should not change outside build rules in
luajit.cmake.


More information about the Tarantool-patches mailing list