Better MinGW build support (#921)
This commit is contained in:
@@ -366,6 +366,13 @@ if(NOT MBGL_QT_LIBRARY_ONLY)
|
|||||||
PRIVATE WORK_DIRECTORY=${PROJECT_SOURCE_DIR}
|
PRIVATE WORK_DIRECTORY=${PROJECT_SOURCE_DIR}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
target_compile_definitions(
|
||||||
|
mbgl-test-runner
|
||||||
|
PRIVATE MBGL_BUILDING_LIB
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
mbgl-test-runner
|
mbgl-test-runner
|
||||||
PRIVATE
|
PRIVATE
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
#include <cerrno>
|
#include <cerrno>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
|
||||||
#if defined(_MSC_VER) && !defined(__clang__)
|
#if defined(WIN32) && !defined(__clang__)
|
||||||
#include <direct.h>
|
#include <direct.h>
|
||||||
#else
|
#else
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
@@ -18,7 +18,7 @@ int main(int argc, char *argv[]) {
|
|||||||
QGuiApplication app(argc, argv);
|
QGuiApplication app(argc, argv);
|
||||||
|
|
||||||
#ifdef WORK_DIRECTORY
|
#ifdef WORK_DIRECTORY
|
||||||
#ifdef _MSC_VER
|
#ifdef WIN32
|
||||||
const int result = _chdir(xstr(WORK_DIRECTORY));
|
const int result = _chdir(xstr(WORK_DIRECTORY));
|
||||||
#else
|
#else
|
||||||
const int result = chdir(xstr(WORK_DIRECTORY));
|
const int result = chdir(xstr(WORK_DIRECTORY));
|
||||||
|
|||||||
@@ -229,7 +229,7 @@ target_link_libraries(
|
|||||||
$<$<AND:$<PLATFORM_ID:Windows>,$<BOOL:MINGW>>:psapi>
|
$<$<AND:$<PLATFORM_ID:Windows>,$<BOOL:MINGW>>:psapi>
|
||||||
)
|
)
|
||||||
|
|
||||||
if(MSVC)
|
if(WIN32)
|
||||||
target_compile_definitions(
|
target_compile_definitions(
|
||||||
mbgl-test
|
mbgl-test
|
||||||
PRIVATE MBGL_BUILDING_LIB
|
PRIVATE MBGL_BUILDING_LIB
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <set>
|
#include <set>
|
||||||
|
|
||||||
#if defined(_MSC_VER) && !defined(__clang__)
|
#if defined(WIN32) && !defined(__clang__)
|
||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
#ifdef GetObject
|
#ifdef GetObject
|
||||||
#undef GetObject
|
#undef GetObject
|
||||||
@@ -97,7 +97,7 @@ static void populateNames(std::vector<std::string>& names) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#if defined(_MSC_VER) && !defined(__clang__)
|
#if defined(WIN32) && !defined(__clang__)
|
||||||
style_directory += "/*";
|
style_directory += "/*";
|
||||||
WIN32_FIND_DATAA ffd;
|
WIN32_FIND_DATAA ffd;
|
||||||
HANDLE hFind = FindFirstFileA(style_directory.c_str(), &ffd);
|
HANDLE hFind = FindFirstFileA(style_directory.c_str(), &ffd);
|
||||||
|
|||||||
Reference in New Issue
Block a user