Open Thomas1664 opened 2 weeks ago
@WangWeiLin-MV I am aware of what FindOpenMP provides. The point is that find_dependency(OpenMP)
may fail and not create the targets, while the "old method" in CMakeLists.txt
will always create the targets. So it may be possible to build the port without OpenMP, but not to use it. This is bad.
... The point is that
find_dependency(OpenMP)
may fail and not create the targets, while the "old method" inCMakeLists.txt
will always create the targets. So it may be possible to build the port without OpenMP, but not to use it. This is bad.
@dg0yt Thanks for your explanation. The upstream uses an old version of CMake
, and it seems that there is no simple way to detect.
@Thomas1664 It might be a safety workaround that disable the option USE_OPENMP
.
vcpkg use a new version of CMake to build that port. It is not necessary to disable OpenMP. I just ask for using the same pattern during build and usage.
vcpkg use a new version of CMake to build that port. It is not necessary to disable OpenMP. I just ask for using the same pattern during build and usage.
@dg0yt How about using the new FindOpenMP and skip the original target creation:
# Find OpenMP and link it.
if(USE_OPENMP)
+ find_package(OpenMP REQUIRED)
+ if(0)
- if(NOT TARGET OpenMP::OpenMP_CXX)
The local test passes, but I haven't test it without omp.
./vcpkg x-add-version --all
and committing the result.