From d7fbfaedc7397c98c3c311fe81355afc66178ae7 Mon Sep 17 00:00:00 2001 From: kichikuou Date: Mon, 16 Sep 2019 10:02:05 +0900 Subject: [PATCH] CMake: Add workaround for MSYS link error --- src/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5860e35..d408a0e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -2,6 +2,12 @@ cmake_minimum_required(VERSION 3.13) project(System3 LANGUAGES CXX) +# In msys, `pkg-config --libs` returns `-lmingw32` but find_library() cannot +# find it in default search paths. +if (MSYS) + list(APPEND CMAKE_LIBRARY_PATH $ENV{MINGW_PREFIX}/$ENV{MINGW_CHOST}/lib) +endif () + set(SRC_COMMON sdlmain.cpp fileio.cpp