diff options
author | Marcin Junczys-Dowmunt <marcinjd@microsoft.com> | 2018-12-10 06:53:57 +0300 |
---|---|---|
committer | Marcin Junczys-Dowmunt <marcinjd@microsoft.com> | 2018-12-10 06:53:57 +0300 |
commit | 36d12cd2855fda44bf5cfc83b778bde8ce76f4f5 (patch) | |
tree | f9886b0f7ab30291771983a9898e77662a956b1e | |
parent | de6a9dfd052c212ead67bf1f485394b512879ac5 (diff) |
link stdlib statically
-rw-r--r-- | CMakeLists.txt | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 8acd8334..e2372667 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -110,6 +110,10 @@ set(EXT_LIBS ${EXT_LIBS} ${CMAKE_DL_LIBS}) if(COMPILE_CUDA) if(USE_STATIC_LIBS) + # link statically to stdlib libraries + set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++") + + # look for libraries that have .a suffix set(_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) if(WIN32) list(INSERT CMAKE_FIND_LIBRARY_SUFFIXES 0 .lib .a) |