summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2015-08-12 20:25:35 +0200
committerSuren A. Chilingaryan <csa@suren.me>2015-08-12 20:25:35 +0200
commit55783eb24e983786056f4ba7925aa23fca13c79e (patch)
tree3a4c9bd7523117f790b411ba8fe4b3907d5e72bc
parent38fdfd8b69ba5ae747915bbdbb3066d29611437d (diff)
downloadpcitool-55783eb24e983786056f4ba7925aa23fca13c79e.tar.gz
pcitool-55783eb24e983786056f4ba7925aa23fca13c79e.tar.bz2
pcitool-55783eb24e983786056f4ba7925aa23fca13c79e.tar.xz
pcitool-55783eb24e983786056f4ba7925aa23fca13c79e.zip
Fix support of older systems: Remove C11 derective and add rt library to the link list
-rw-r--r--CMakeLists.txt6
-rw-r--r--pcilib/CMakeLists.txt2
-rw-r--r--pcitool/CMakeLists.txt2
3 files changed, 6 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bbe5a74..337a366 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -12,6 +12,8 @@ set(DISABLE_PCITOOL FALSE CACHE BOOL "Build only the library")
find_package(PkgConfig REQUIRED)
find_package(Threads REQUIRED)
+set(EXTRA_SYSTEM_LIBS -lrt)
+
#Check in sibling directory
if (NOT DISABLE_PCITOOL)
pkg_check_modules(FASTWRITER fastwriter REQUIRED)
@@ -19,8 +21,8 @@ endif (NOT DISABLE_PCITOOL)
check_include_files(stdatomic.h HAVE_STDATOMIC_H)
-add_definitions("-fPIC --std=c11 -Wall -O2 -gdwarf-2 -g3")
-#add_definitions("-fPIC --std=c11 -Wall -O2")
+add_definitions("-fPIC --std=c99 -Wall -O2 -gdwarf-2 -g3")
+#add_definitions("-fPIC --std=c99 -Wall -O2")
include(cmake/version.cmake)
VERSION_TO_VARS(${PCILIB_VERSION} PCILIB_VERSION_MAJOR PCILIB_VERSION_MINOR PCILIB_VERSION_MICRO)
diff --git a/pcilib/CMakeLists.txt b/pcilib/CMakeLists.txt
index 79b15c2..be59cb7 100644
--- a/pcilib/CMakeLists.txt
+++ b/pcilib/CMakeLists.txt
@@ -5,7 +5,7 @@ include_directories(
set(HEADERS pcilib.h pci.h export.h bar.h fifo.h model.h bank.h register.h kmem.h irq.h locking.h lock.h dma.h event.h plugin.h tools.h error.h debug.h env.h version.h config.h)
add_library(pcilib SHARED pci.c export.c bar.c fifo.c model.c bank.c register.c kmem.c irq.c locking.c lock.c dma.c event.c plugin.c tools.c error.c debug.c env.c )
-target_link_libraries(pcilib dma protocols ${CMAKE_THREAD_LIBS_INIT} ${UFODECODE_LIBRARIES} ${CMAKE_DL_LIBS})
+target_link_libraries(pcilib dma protocols ${CMAKE_THREAD_LIBS_INIT} ${UFODECODE_LIBRARIES} ${CMAKE_DL_LIBS} ${EXTRA_SYSTEM_LIBS})
add_dependencies(pcilib dma protocols)
install(TARGETS pcilib
diff --git a/pcitool/CMakeLists.txt b/pcitool/CMakeLists.txt
index 1b21041..fc88de6 100644
--- a/pcitool/CMakeLists.txt
+++ b/pcitool/CMakeLists.txt
@@ -15,7 +15,7 @@ if (NOT DISABLE_PCITOOL)
add_dependencies(pci pcitool)
target_link_libraries(pci pcilib ${FASTWRITER_LIBRARIES})
set_target_properties(pci PROPERTIES
- LINK_FLAGS ${CMAKE_THREAD_LIBS_INIT}
+ LINK_FLAGS "${CMAKE_THREAD_LIBS_INIT} ${EXTRA_SYSTEM_LIBS}"
)
#set_target_properties(pci PROPERTIES