aboutsummaryrefslogtreecommitdiffstats
path: root/host/CMakeLists.txt
diff options
context:
space:
mode:
authorAshish Chaudhari <ashish@ettus.com>2015-03-17 13:52:29 -0700
committerAshish Chaudhari <ashish@ettus.com>2015-03-17 13:52:29 -0700
commit6a34824ad10eaa2d2b642b959f278f6c4e326d6d (patch)
tree1aa582ee8e5cef716b59ec4deb3a8e5f4f532929 /host/CMakeLists.txt
parent5682321efa26bb97f5d0c37d8e9921fc11a9b923 (diff)
parent306b5243e12af0db493856ad8397abac9835db0c (diff)
downloaduhd-6a34824ad10eaa2d2b642b959f278f6c4e326d6d.tar.gz
uhd-6a34824ad10eaa2d2b642b959f278f6c4e326d6d.tar.bz2
uhd-6a34824ad10eaa2d2b642b959f278f6c4e326d6d.zip
Merge branch 'master' into ashish/vivado
Diffstat (limited to 'host/CMakeLists.txt')
-rw-r--r--host/CMakeLists.txt20
1 files changed, 18 insertions, 2 deletions
diff --git a/host/CMakeLists.txt b/host/CMakeLists.txt
index e2937edd3..0c168e09b 100644
--- a/host/CMakeLists.txt
+++ b/host/CMakeLists.txt
@@ -99,12 +99,12 @@ ENDIF(ENABLE_STATIC_LIBS)
IF(APPLE)
IF(NOT CMAKE_INSTALL_NAME_DIR)
SET(CMAKE_INSTALL_NAME_DIR
- ${CMAKE_INSTALL_PREFIX}/${GR_LIBRARY_DIR} CACHE
+ ${CMAKE_INSTALL_PREFIX}/${LIBRARY_DIR} CACHE
PATH "Library Install Name Destination Directory" FORCE)
ENDIF(NOT CMAKE_INSTALL_NAME_DIR)
IF(NOT CMAKE_INSTALL_RPATH)
SET(CMAKE_INSTALL_RPATH
- ${CMAKE_INSTALL_PREFIX}/${GR_LIBRARY_DIR} CACHE
+ ${CMAKE_INSTALL_PREFIX}/${LIBRARY_DIR} CACHE
PATH "Library Install RPath" FORCE)
ENDIF(NOT CMAKE_INSTALL_RPATH)
IF(NOT CMAKE_BUILD_WITH_INSTALL_RPATH)
@@ -166,6 +166,22 @@ IF(MSVC)
ADD_DEFINITIONS(/MP) #multi-threaded build
ENDIF(MSVC)
+IF(MINGW)
+ #Avoid depending on MinGW runtime DLLs
+ CHECK_CXX_COMPILER_FLAG(-static-libgcc HAVE_STATIC_LIBGCC_FLAG)
+ IF(HAVE_STATIC_LIBGCC_FLAG)
+ SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc")
+ SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static-libgcc")
+ SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -static-libgcc")
+ ENDIF()
+ CHECK_CXX_COMPILER_FLAG(-static-libstdc++ HAVE_STATIC_LIBSTDCXX_FLAG)
+ IF(HAVE_STATIC_LIBSTDCXX_FLAG)
+ SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libstdc++")
+ SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static-libstdc++")
+ SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -static-libstdc++")
+ ENDIF()
+ENDIF()
+
IF(CYGWIN)
ADD_DEFINITIONS(-D__USE_W32_SOCKETS) #boost asio says we need this
ENDIF(CYGWIN)