cmake.patch 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. diff --git a/CMakeLists.txt b/CMakeLists.txt
  2. index 827ca29..cfd1b9c 100644
  3. --- a/CMakeLists.txt
  4. +++ b/CMakeLists.txt
  5. @@ -15,7 +15,7 @@ else ()
  6. endif ()
  7. # Some builds need position-independent code.
  8. -set (CMAKE_POSITION_INDEPENDENT_CODE ON)
  9. +
  10. # Allow nsync users to turn the tests on or off.
  11. option (NSYNC_ENABLE_TESTS "Enable for building tests" ON)
  12. @@ -90,7 +90,9 @@ endif ()
  13. # Pick the include directory for the operating system.
  14. if ("${CMAKE_SYSTEM_NAME}X" STREQUAL "WindowsX")
  15. include_directories ("${PROJECT_SOURCE_DIR}/platform/win32")
  16. - set (NSYNC_CPP_FLAGS "/TP")
  17. + if (MSVC)
  18. + set (NSYNC_CPP_FLAGS "/TP")
  19. + endif()
  20. set (NSYNC_OS_SRC
  21. ${NSYNC_POSIX_SRC}
  22. @@ -125,7 +127,6 @@ elseif ("${CMAKE_SYSTEM_NAME}X" STREQUAL "DarwinX")
  23. ${NSYNC_OS_CPP_SRC}
  24. "platform/c++11/src/nsync_semaphore_mutex.cc"
  25. "platform/posix/src/clock_gettime.c"
  26. - "platform/posix/src/nsync_semaphore_mutex.c"
  27. )
  28. elseif ("${CMAKE_SYSTEM_NAME}X" STREQUAL "LinuxX")
  29. set (NSYNC_POSIX ON)
  30. @@ -402,11 +403,13 @@ set (CMAKE_SKIP_INSTALL_ALL_DEPENDENCY ON)
  31. install (TARGETS nsync EXPORT nsync
  32. LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT RuntimeLibraries
  33. - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Development)
  34. + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Development
  35. + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
  36. install (TARGETS nsync_cpp EXPORT nsync_cpp OPTIONAL
  37. LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT RuntimeLibraries
  38. - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Development)
  39. + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Development
  40. + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
  41. set (NSYNC_INCLUDES
  42. "public/nsync.h"