From 213c69dfc1ec588a8811cad03f79a4bf189cf6b5 Mon Sep 17 00:00:00 2001 From: Tom Collins Date: Tue, 23 Jun 2020 22:41:05 -0700 Subject: [PATCH] build: make non-MSVC executables statically linked When building in MSYS2/MinGW64, I was missing multiple DLLs necessary to run the EXE files from a command prompt. --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 75b7ac9..b949ae3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -169,6 +169,9 @@ if(MSVC) set(YAML_CPP_LIB "${CMAKE_STATIC_LIBRARY_PREFIX}${YAML_CPP_LIB}${LIB_RT_SUFFIX}") set(YAML_CPP_LIB_DBG "${YAML_CPP_LIB}d") endif() +else() + # make sure executable files are standalone + SET(CMAKE_EXE_LINKER_FLAGS "-static") endif()