diff --git a/template.cmake b/template.cmake index f7e694b..b934f9e 100644 --- a/template.cmake +++ b/template.cmake @@ -61,6 +61,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 @@ -370,6 +372,11 @@ 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) target_link_libraries( ${LIBRARY_NAME}