summaryrefslogtreecommitdiff
path: root/cmake/Static.cmake
blob: 682527aff61f273b2f7c5017c38ff8af6f3e1e47 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# Set static linking if the platform requires it.
#
# set_static()
#
function(set_static_if_needed)
     if(MINGW)
        # Let exectutables run outside MinGW environment
        # Force searching static libs
        set(CMAKE_FIND_LIBRARY_SUFFIXES ".a" PARENT_SCOPE)

        # Force static linking
        link_libraries(-static -static-libgcc -static-libstdc++)
    endif()
endfunction()