ROCm / ROCm-OpenCL-Driver

ROCm OpenCL Compiler Tool Driver
MIT License
24 stars 9 forks source link

[cmake] Incorrect gtest lib directory detection #76

Closed FinnStokes closed 5 years ago

FinnStokes commented 5 years ago

When linking roc-cl-unittest, ld raises the error

ld: cannot find -lgtest
ld: cannot find -lgtest_main

despite the fact that the googletest library has just compiled and should be linked against. This seems to be due to an error in src/unittest/CMakeLists.txt. If I change line 66 from

link_directories(${binary_dir}/googletest)

to

link_directories(${binary_dir}/lib)

then it seems to link fine.

emankov commented 5 years ago

It looks like ExternalProject_Get_Property(googletest binary_dir) gets a correct folder for binary_dir - googletest-build, but the libs to link are in a subfolder lib, not in a subfolder googletest. So your fix looks correct.

Please create a pull request with your fix. Thanks.