[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kservice] /: Always update the Trader parser from y/l sources
From:       Pino Toscano <pino () kde ! org>
Date:       2016-07-10 5:27:56
Message-ID: E1bM7HY-00007F-Sa () code ! kde ! org
[Download RAW message or body]

Git commit 0cf33ffbf88777a86635948ed03917253342569c by Pino Toscano.
Committed on 10/07/2016 at 05:22.
Pushed by pino into branch 'master'.

Always update the Trader parser from y/l sources

Add Flex and Bison as required build dependencies, and use them to
always regenerate at build time the Trader parser. This ensures that
the parser does not rot, and there is no more need to rely on
autogenerated sources added statically among the others.

REVIEW: 127984

M  +16   -0    CMakeLists.txt
M  +13   -2    src/CMakeLists.txt

http://commits.kde.org/kservice/0cf33ffbf88777a86635948ed03917253342569c

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5e09e1a..ca35610 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -45,6 +45,22 @@ find_package(KF5DBusAddons ${KF5_DEP_VERSION} REQUIRED)
 find_package(KF5I18n ${KF5_DEP_VERSION} REQUIRED)
 find_package(KF5DocTools ${KF5_DEP_VERSION})
 =

+find_package(FLEX REQUIRED)
+set_package_properties(FLEX PROPERTIES
+    URL "http://flex.sourceforge.net"
+    DESCRIPTION "Fast Lexical Analyzer"
+    TYPE REQUIRED
+    PURPOSE "Required for the Trader parser"
+)
+
+find_package(BISON REQUIRED)
+set_package_properties(BISON PROPERTIES
+    URL "http://www.gnu.org/software/bison"
+    DESCRIPTION "general-purpose parser generator"
+    TYPE REQUIRED
+    PURPOSE "Required for the Trader parser"
+)
+
 # create a Config.cmake and a ConfigVersion.cmake file and install them
 set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5Service")
 =

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index cdcf885..058c6e5 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -21,8 +21,6 @@ set(kservice_SRCS
    services/kservicetypetrader.cpp
    services/ktraderparse.cpp
    services/ktraderparsetree.cpp
-   services/yacc.c
-   services/lex.c
    services/kplugininfo.cpp
    sycoca/ksycoca.cpp
    sycoca/ksycocadevices.cpp
@@ -53,6 +51,19 @@ if (UNIX)
    )
 endif()
 =

+bison_target(TraderParser
+             services/yacc.y
+             ${CMAKE_CURRENT_BINARY_DIR}/yacc.c
+             COMPILE_FLAGS "-p kiotrader -d"
+)
+flex_target(TraderLexer
+            services/lex.l
+            ${CMAKE_CURRENT_BINARY_DIR}/lex.c
+            COMPILE_FLAGS "-Pkiotrader -B -i"
+)
+add_flex_bison_dependency(TraderLexer TraderParser)
+list(APPEND kservice_SRCS ${BISON_TraderParser_OUTPUTS} ${FLEX_TraderLexer=
_OUTPUTS})
+
 # kservice cannot depend on kinit (because kinit->kio->kservice), so we ne=
ed a copy of org.kde.KLauncher.xml here.
 # And I don't want to have it here as a source file (who wants to edit dbu=
s xml by hand), so it can be
 # generated from klauncher's implementation header.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic