google / highway

Performance-portable, length-agnostic SIMD with runtime dispatch
Apache License 2.0
3.97k stars 308 forks source link

cmake gives error: CMake can not determine linker language #2133

Closed kfjahnke closed 2 months ago

kfjahnke commented 2 months ago

I just checked out master and tried to configure cmake, in the build folder, using my usual line of cmake -DBUILD_TESTING=OFF -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang ..

This failed, with these error messages:

CMake Error: Cannot determine link language for target "hwy".
CMake Error: CMake can not determine linker language for target: hwy
CMake Error in CMakeLists.txt:
  Exporting the target "hwy" is not allowed since its linker language cannot
  be determined

To fix this, I tried and modified the CMakeLists.txt, adding this line: set_property(TARGET hwy PROPERTY LINKER_LANGUAGE CXX) the error in the cmake invocation went away, but then I got plenty of linker errors. I did a regression. The error only occurs from commit 99bf9204d043dbaa4f56ee17d80e5b1f8a5f3f86, when reverting to the previous commit 3adbb629e526096b698e04dc1dbe23418bf6c4b8 all works as expected, with unmodified CMakeLists.txt

kfjahnke commented 2 months ago

Ah, and with -DHWY_CMAKE_HEADER_ONLY=ON master builds as well. must be the new feature.

jan-wassenberg commented 2 months ago

Thanks for letting us know! Oops, I got the condition wrong, should be NOT header only. Fixing shortly :)