mirror of
https://github.com/microsoft/mimalloc.git
synced 2024-12-26 21:04:27 +08:00
ensure cmake uses C++ compilation with MSVC
This commit is contained in:
parent
13364b50b8
commit
c02a0c9b49
@ -26,7 +26,6 @@ set(mi_sources
|
|||||||
src/options.c
|
src/options.c
|
||||||
src/init.c)
|
src/init.c)
|
||||||
|
|
||||||
|
|
||||||
# Set default build type
|
# Set default build type
|
||||||
if (NOT CMAKE_BUILD_TYPE)
|
if (NOT CMAKE_BUILD_TYPE)
|
||||||
if ("${CMAKE_BINARY_DIR}" MATCHES ".*(D|d)ebug$")
|
if ("${CMAKE_BINARY_DIR}" MATCHES ".*(D|d)ebug$")
|
||||||
@ -44,6 +43,11 @@ if("${CMAKE_BINARY_DIR}" MATCHES ".*(S|s)ecure$")
|
|||||||
set(MI_SECURE "ON")
|
set(MI_SECURE "ON")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(CMAKE_C_COMPILER_ID MATCHES "MSVC")
|
||||||
|
set(MI_USE_CXX "ON")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
# Options
|
# Options
|
||||||
if(MI_OVERRIDE MATCHES "ON")
|
if(MI_OVERRIDE MATCHES "ON")
|
||||||
message(STATUS "Override standard malloc (MI_OVERRIDE=ON)")
|
message(STATUS "Override standard malloc (MI_OVERRIDE=ON)")
|
||||||
@ -78,7 +82,7 @@ endif()
|
|||||||
if(MI_USE_CXX MATCHES "ON")
|
if(MI_USE_CXX MATCHES "ON")
|
||||||
message(STATUS "Use the C++ compiler to compile (MI_USE_CXX=ON)")
|
message(STATUS "Use the C++ compiler to compile (MI_USE_CXX=ON)")
|
||||||
set_source_files_properties(${mi_sources} PROPERTIES LANGUAGE CXX )
|
set_source_files_properties(${mi_sources} PROPERTIES LANGUAGE CXX )
|
||||||
set_source_files_properties(src/static.c test/test-api.c PROPERTIES LANGUAGE CXX )
|
set_source_files_properties(src/static.c test/test-api.c test/test-stress.c PROPERTIES LANGUAGE CXX )
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Compiler flags
|
# Compiler flags
|
||||||
|
Loading…
x
Reference in New Issue
Block a user