Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pthread usage in CMake #307

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions libfswatch/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ check_struct_has_member("struct stat" st_mtimespec sys/stat.h HAVE_STRUCT_STAT_S
check_include_file_cxx(unordered_map HAVE_UNORDERED_MAP)
check_include_file_cxx(unordered_set HAVE_UNORDERED_SET)

find_library(PTHREAD_LIBRARY pthread)
set(EXTRA_LIBS ${EXTRA_LIBS} ${PTHREAD_LIBRARY})
find_package(Threads REQUIRED)
set(EXTRA_LIBS ${EXTRA_LIBS} Threads::Threads)

check_include_file_cxx(sys/inotify.h HAVE_SYS_INOTIFY_H)

Expand Down
3 changes: 2 additions & 1 deletion test/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
#
find_package(Threads REQUIRED)
set(SOURCE_FILES
fswatch_test.c
${PROJECT_BINARY_DIR}/libfswatch/libfswatch_config.h)

add_executable(fswatch_test ${SOURCE_FILES})
target_include_directories(fswatch_test PRIVATE ../.. .)
target_include_directories(fswatch_test PRIVATE ${PROJECT_BINARY_DIR})
target_link_libraries(fswatch_test PUBLIC libfswatch)
target_link_libraries(fswatch_test PUBLIC libfswatch Threads::Threads)