OpenTTD-patches/cmake/Static.cmake
Patric Stout 56d54cf60e Add: introduce CMake for project management
CMake works on all our supported platforms, like MSVC, Mingw, GCC,
Clang, and many more. It allows for a single way of doing things,
so no longer we need shell scripts and vbs scripts to work on all
our supported platforms.

Additionally, CMake allows to generate project files for like MSVC,
KDevelop, etc.

This heavily reduces the lines of code we need to support multiple
platforms from a project perspective.

Addtiionally, this heavily improves our detection of libraries, etc.
2020-06-05 19:36:05 +02:00

15 lines
393 B
CMake

# 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()