Skip to content

[flang] Different fir-opt tool is produced depending on FLANG_INCLUDE_TESTS #121202

@mgorny

Description

@mgorny

The fir-opt tool that is installed unconditionally has some code conditional to FLANG_INCLUDE_TESTS. This implies that the tool installed as part of a CMake run with tests being built will be different than the tool installed otherwise.

At the very least, this goes against the principle of least surprise, and violates the Gentoo-specific policy that testing must not affect the installed package. Also, this is quite problematic for us since it implies static linking to MLIR (as the relevant test-specific MLIR libraries aren't available in the dylib — which could be acceptable for discardable test executables, but it's not fine for installed executables).

Could we perhaps build two versions of fir-opt instead? One that would not contain test-specific code and be installed, and another one with test-specific code that's only used by the test suite? I can submit a pull request if you agree with that approach.

Metadata

Metadata

Assignees

No one assigned

    Labels

    cmakeBuild system in general and CMake in particularflangFlang issues not falling into any other category

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions