From cb2481efdcc40662b53bf40551c3cf15029a23b9 Mon Sep 17 00:00:00 2001 From: Wouter van Oortmerssen Date: Wed, 10 May 2017 15:42:23 -0700 Subject: [PATCH] Ensured flatc.exe is statically linked on Windows --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index ab7f415dc..b9d44a2a9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -173,6 +173,10 @@ if(FLATBUFFERS_BUILD_FLATC) if(NOT FLATBUFFERS_FLATC_EXECUTABLE) set(FLATBUFFERS_FLATC_EXECUTABLE $) endif() + if(MSVC) + # Make flatc.exe not depend on runtime dlls for easy distribution. + target_compile_options(flatc PUBLIC $<$:/MT>) + endif() endif() if(FLATBUFFERS_BUILD_FLATHASH)