From 50624b89918a5768e8781e3b46e3761dcb1bcbc3 Mon Sep 17 00:00:00 2001 From: Anselme Date: Tue, 27 Dec 2016 13:53:45 +0100 Subject: [PATCH 1/2] fixed comiplation errors on linux --- template.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/template.cmake b/template.cmake index dbb2f14..2af814c 100644 --- a/template.cmake +++ b/template.cmake @@ -365,8 +365,12 @@ include_directories( ${EXTRA_INCLUDES} ) +if(UNIX) + # -ldl seems to be required for linux executables + LIST(APPEND LIB_DEPENDENCIES_LIST dl) +endif() + if(LIB_SRC_LIST) - # please do not add -ldl here for all systems without any explanation target_link_libraries( ${LIBRARY_NAME} ${LIB_DEPENDENCIES_LIST} From 53f173fc12aabd4e710ed5f052fb5f58b9e5f008 Mon Sep 17 00:00:00 2001 From: Anselme Date: Sun, 1 Jan 2017 22:05:09 +0100 Subject: [PATCH 2/2] added static linking of the standard libraries --- template.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/template.cmake b/template.cmake index dbb2f14..2884ee2 100644 --- a/template.cmake +++ b/template.cmake @@ -60,6 +60,8 @@ else() set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LIB_RELEASE_PATH}) #for SHARED list(APPEND LIB_PATHS ${LIB_RELEASE_PATH}) + + add_definitions(-static-libgcc -static-libstdc++) endif() #create library and executable