From e366bd7a71b8dd5011935f34272dbaca7f273f87 Mon Sep 17 00:00:00 2001 From: Matt Kelly Date: Fri, 14 Feb 2014 13:58:54 -0500 Subject: [PATCH 1/2] Fixed for Linux - pushing to test on OS X --- common/CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 51ce1650..38413187 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -48,5 +48,8 @@ INCLUDE_DIRECTORIES(${PROTOBUF_INCLUDE_DIR}) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) add_library(cockatrice_common ${common_SOURCES} ${common_HEADERS_MOC}) -target_link_libraries(cockatrice_common cockatrice_protocol) - +if (UNIX) + target_link_libraries(cockatrice_common cockatrice_protocol pthread) +else (UNIX) + target_link_libraries(cockatrice_common cockatrice_protocol) +endif (UNIX) From b93317cc17d5ada0a6c2d882bf500d925d61f462 Mon Sep 17 00:00:00 2001 From: Matt Kelly Date: Fri, 14 Feb 2014 14:14:10 -0500 Subject: [PATCH 2/2] OS X still works with pthread fix - added explanation --- common/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 38413187..3a8031b1 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -48,6 +48,7 @@ INCLUDE_DIRECTORIES(${PROTOBUF_INCLUDE_DIR}) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) add_library(cockatrice_common ${common_SOURCES} ${common_HEADERS_MOC}) +# Without this check, Linux will put -pthread out of order in link.txt and build will fail if (UNIX) target_link_libraries(cockatrice_common cockatrice_protocol pthread) else (UNIX)