thrift-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mario Emmenlauer (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (THRIFT-4560) The logic of CMAKE_DEPENDENT_OPTION seems wrong and can break the build
Date Thu, 26 Apr 2018 14:45:00 GMT

     [ https://issues.apache.org/jira/browse/THRIFT-4560?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Mario Emmenlauer updated THRIFT-4560:
-------------------------------------
    Description: 
The cmake build uses {{CMAKE_DEPENDENT_OPTION}} in several places. But according to my understanding,
the resulting logic is wrong and can lead to problems. Consider the following example for
building with Qt4 or Qt5 from {{build/cmake/DefineOptions.cmake}}:

{noformat}
    find_package(Qt5 QUIET COMPONENTS Core Network)
    CMAKE_DEPENDENT_OPTION(WITH_QT5 "Build with Qt5 support" ON
                           "Qt5_FOUND" OFF)
{noformat}

If a user configures thrift with {{cmake -DWITH_QT5=ON}} but does not have Qt5 installed,
they will not get an error. They will just get a warning that the option {{WITH_QT5}} was
unused.
Furthermore, if the user disables Qt5 (i.e. because its broken), then {{cmake -DWITH_QT5=OFF}}
will **not** disable the search for Qt5. If the {{find_package(Qt5 QUIET COMPONENTS Core Network)}}
fails in error, the build will fail, despite the explicit request for {{cmake -DWITH_QT5=OFF}}.

  was:
The cmake build uses {{CMAKE_DEPENDENT_OPTION}} in several places. But according to my understanding,
the resulting logic is wrong and can lead to problems. Consider the following example for
building with Qt4 or Qt5 from {{build/cmake/DefineOptions.cmake}}:

{noformat}
    find_package(Qt5 QUIET COMPONENTS Core Network)
    CMAKE_DEPENDENT_OPTION(WITH_QT5 "Build with Qt5 support" ON
                           "Qt5_FOUND" OFF)
{noformat}

If a user configures thrift with {{cmake -DWITH_QT5=ON}} but does not have Qt5 installed,
they will not get an error. They will just get a warning that the option {{WITH_QT5}} was
unused.
Furthermore, if the user must disable Qt5 (i.e. because its broken), then {{cmake -DWITH_QT5=OFF}}
will **not** disable the search for Qt5. If the {{find_package(Qt5 QUIET COMPONENTS Core Network)}}
fails in error, the build will fail, despite {{cmake -DWITH_QT5=OFF}}.


> The logic of CMAKE_DEPENDENT_OPTION seems wrong and can break the build
> -----------------------------------------------------------------------
>
>                 Key: THRIFT-4560
>                 URL: https://issues.apache.org/jira/browse/THRIFT-4560
>             Project: Thrift
>          Issue Type: Bug
>          Components: Build Process
>    Affects Versions: 1.0
>            Reporter: Mario Emmenlauer
>            Priority: Minor
>
> The cmake build uses {{CMAKE_DEPENDENT_OPTION}} in several places. But according to my
understanding, the resulting logic is wrong and can lead to problems. Consider the following
example for building with Qt4 or Qt5 from {{build/cmake/DefineOptions.cmake}}:
> {noformat}
>     find_package(Qt5 QUIET COMPONENTS Core Network)
>     CMAKE_DEPENDENT_OPTION(WITH_QT5 "Build with Qt5 support" ON
>                            "Qt5_FOUND" OFF)
> {noformat}
> If a user configures thrift with {{cmake -DWITH_QT5=ON}} but does not have Qt5 installed,
they will not get an error. They will just get a warning that the option {{WITH_QT5}} was
unused.
> Furthermore, if the user disables Qt5 (i.e. because its broken), then {{cmake -DWITH_QT5=OFF}}
will **not** disable the search for Qt5. If the {{find_package(Qt5 QUIET COMPONENTS Core Network)}}
fails in error, the build will fail, despite the explicit request for {{cmake -DWITH_QT5=OFF}}.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message