From cbae33a6899093148c1fb92c0050d033d0336c0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81d=C3=A1m=20Kallai?= Date: Fri, 1 Nov 2019 20:29:17 +0100 Subject: [PATCH] Add '-flto' flag to pkg-config if the libraries built with lto (#3274) If we build Jerry libraries with lto, this information should be passed to pkg-config as well. JerryScript-DCO-1.0-Signed-off-by: Adam Kallai kadam@inf.u-szeged.hu --- jerry-core/CMakeLists.txt | 5 +++++ jerry-core/libjerry-core.pc.in | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/jerry-core/CMakeLists.txt b/jerry-core/CMakeLists.txt index 240138f52..92a65baf2 100644 --- a/jerry-core/CMakeLists.txt +++ b/jerry-core/CMakeLists.txt @@ -400,6 +400,11 @@ target_include_directories(${JERRY_CORE_NAME} PRIVATE ${INCLUDE_CORE_PRIVATE}) set(JERRY_CORE_PKGCONFIG_REQUIRES) set(JERRY_CORE_PKGCONFIG_LIBS) +set(JERRY_CORE_PKGCONFIG_CFLAGS) + +if(ENABLE_LTO) + set(JERRY_CORE_PKGCONFIG_CFLAGS "${JERRY_CORE_PKGCONFIG_CFLAGS} -flto") +endif() if(JERRY_LIBM) target_link_libraries(${JERRY_CORE_NAME} jerry-libm) diff --git a/jerry-core/libjerry-core.pc.in b/jerry-core/libjerry-core.pc.in index ed38855cf..977172397 100644 --- a/jerry-core/libjerry-core.pc.in +++ b/jerry-core/libjerry-core.pc.in @@ -9,4 +9,4 @@ Version: 1.0 Requires.private: @JERRY_CORE_PKGCONFIG_REQUIRES@ # NOTE: libjerry-port-default* is not added as a required package Libs: -L${libdir} -ljerry-core Libs.private: @JERRY_CORE_PKGCONFIG_LIBS@ -Cflags: -I${includedir} +Cflags: -I${includedir} @JERRY_CORE_PKGCONFIG_CFLAGS@