Skip to content

Partial overhaul of cmake + complete overhaul of cmake handling of third-party libraries #1100

@jrmadsen

Description

@jrmadsen

Hi, I am trying to utilize dyninst as a submodule and I've found that the handling of installing the 3rd-party libraries is a bit of a nightmare.

Here is my preliminary list of changes:

  • generally replace all add_definitions, include_directories, etc. with modern CMake target-based alternatives, e.g. target_compile_definitions, target_include_directories, etc. which have the capability to propagate those directives to other cmake targets which "link" to them.
  • Replace ExternalProject_Add with add_subdirectory when the subdirectory is a cmake project
  • Create explicit Dyninst_BUILD_<TPL> options to explicitly control whether to build the third-party library or do find_package(<TPL> REQUIRED)
    • this has the benefit of allowing for failure if the package was not found but users do not want to build the TPL
  • Fix DyninstConfig.cmake to make a proper interface target
  • Fix target installation to namespace the dyninst targets, e.g. symtabAPI -> Dyninst::symtabAPI
  • In the third-party library handling, utilize BUILD_INTERFACE and INSTALL_INTERFACE generator expressions to fix the broken support for Ninja as a generator

Here are my questions:

  1. Are y'all open to accepting a PR of this nature?
    • I'm going to do this anyway because it is completely unreliable but I just want to know if it will be accepted upstream
  2. Is there any reason why y'all truly need cmake support back to v3.4.0, I consider v3.13 to be the minimal ideal minimum since it includes the target_link_options support

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions