yaml-cpp icon indicating copy to clipboard operation
yaml-cpp copied to clipboard

Setting `YAML_CPP_BUILD_TEST` to `OFF` causes issues with Threads on Windows

Open Zerophase opened this issue 4 years ago • 1 comments
trafficstars

I have to run generate the cmake solution twice through Visual Studio.

I tried turning off building tests with,

set(YAML_CPP_BUILD_TESTS OFF CACHE BOOL "Enable testing" FORCE)

;but, cmake still needs the threads library to build yaml-cpp.

So, after the previously mentioned command I ran:

set(CMAKE_USE_WIN32_THREADS_INIT ON CACHE BOOL "" FORCE)

which gets picked up on the second run and allows me to finish generating. Is there a work around for this? Is this an issue in the yaml-cpp cmake?

Zerophase avatar May 04 '21 10:05 Zerophase

Can you share your CMakeLists.txt or a part of it as a "Minimal Reproducible Example"?

Also I do not think that you should be setting CMAKE_USE_WIN32_THREADS_INIT explicitly as it is a result variable of find_package(Threads).

A weird (and probably unrelated) shot in the dark but, could you try this?

cmake .. -Dgtest_disable_pthreads=ON

Regards.

Akaame avatar Aug 02 '21 21:08 Akaame