smarco / WFA2-lib

WFA-lib: Wavefront alignment algorithm library v2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Broken build with OMP enabled

pettyalex opened this issue · comments

WFA2-lib is not building for me with cmake version 3.25.2 when OpenMP is enabled.

It looks like #64 illegally used a mix of plain and keyword-based CMake syntax for linking libraries: https://stackoverflow.com/questions/59522267/cmake-rejects-a-second-target-link-libraries-talking-about-keyword-vs-plain

Reproduction:

Build with OpenMP:

mkdir build &&  cd build
cmake -DOPENMP=ON ..
cmake --build .

Fail:

CMake Error at CMakeLists.txt:176 (target_link_libraries):
  The keyword signature for target_link_libraries has already been used with
  the target "wfa2cpp_static".  All uses of target_link_libraries with a
  target must be either all-keyword or all-plain.

  The uses of the keyword signature are here:

   * CMakeLists.txt:171 (target_link_libraries)



CMake Error at CMakeLists.txt:177 (target_link_libraries):
  The keyword signature for target_link_libraries has already been used with
  the target "wfa2cpp".  All uses of target_link_libraries with a target must
  be either all-keyword or all-plain.

  The uses of the keyword signature are here:

   * CMakeLists.txt:170 (target_link_libraries)

Solutions: Specify the scope of how OpenMP is linked to WFA2-lib. I don't see any reason to publicly expose this, so PRIVATE seems like the default option.

Thanks for the fix.