diff options
-rw-r--r-- | CMakeLists.txt | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index b26fdee..97a49ab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,6 +9,7 @@ set(DISABLE_PCITOOL FALSE CACHE BOOL "Build only the library") find_package(PkgConfig REQUIRED) +find_package(Threads REQUIRED) #Check in sibling directory pkg_check_modules(UFODECODE ufodecode REQUIRED) @@ -18,7 +19,8 @@ if (NOT DISABLE_PCITOOL) endif (NOT DISABLE_PCITOOL) set(HEADERS pcilib.h pci.h register.h kmem.h irq.h dma.h event.h default.h tools.h error.h) -add_definitions("-fPIC --std=c99 -Wall -O2 -pthread") +add_definitions("-fPIC --std=c99 -Wall -O2") +#add_definitions("-fPIC --std=c99 -Wall -O2 -pthread") add_subdirectory(dma) add_subdirectory(ipecamera) @@ -31,7 +33,8 @@ add_dependencies(pcilib dma ipecamera) set_target_properties(pcilib PROPERTIES VERSION ${PCILIB_VERSION} SOVERSION ${PCILIB_ABI_VERSION} - LINK_FLAGS "-pthread" + LINK_FLAGS ${CMAKE_THREAD_LIBS_INIT} +# LINK_FLAGS "-pthread" # LINK_FLAGS "-pthread -Wl,--whole-archive,dma/libdma.a,ipecamera/libipecamera.a,--no-whole-archive" ) @@ -40,7 +43,7 @@ if (NOT DISABLE_PCITOOL) add_dependencies(pci pcitool) target_link_libraries(pci pcilib pcitool fastwriter) set_target_properties(pci PROPERTIES - LINK_FLAGS "-pthread" + LINK_FLAGS ${CMAKE_THREAD_LIBS_INIT} ) endif (NOT DISABLE_PCITOOL) |