mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-04 17:40:01 +00:00
Fix compiling tests with dynamic libc on MSVC
This commit is contained in:
parent
08bb51e358
commit
d8d9f8072c
@ -163,9 +163,16 @@ else()
|
||||
add_definitions(-DNDEBUG)
|
||||
endif()
|
||||
|
||||
# Fix to compile gtest with VC11 (2012)
|
||||
if(MSVC_VERSION EQUAL 1700)
|
||||
add_definitions(-D_VARIADIC_MAX=10)
|
||||
if(MSVC)
|
||||
if(USE_STATIC_LIBC)
|
||||
if(CMAKE_BUILD_TYPE STREQUAL Debug)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -MTd")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -MTd")
|
||||
else()
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -MT")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -MT")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT WIN32 AND NOT APPLE AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
@ -438,6 +445,10 @@ if(ENABLE_MEMLEAK)
|
||||
add_definitions(-DLAF_MEMLEAK)
|
||||
endif()
|
||||
|
||||
if(NOT USE_STATIC_LIBC)
|
||||
set(gtest_force_shared_crt ON CACHE BOOL "Use shared (DLL) run-time lib even when Google Test is built as static lib.")
|
||||
endif()
|
||||
|
||||
set(LAF_WITH_TESTS ${ENABLE_TESTS} CACHE BOOL "Enable LAF tests")
|
||||
add_subdirectory(laf)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user