Commit 3c3eb3b3 by Tang, Cheng Committed by Tianqi Chen

add use_mt option, default to use md as mt won't work with current c++ api (#484)

parent 7f5d22d7
......@@ -31,18 +31,21 @@ add_definitions(-DNNVM_EXPORTS)
# Build a shared lib (libnnvm.so) by default
option(BUILD_SHARED_NNVM "Build a shared nnvm lib" ON)
option(BUILD_STATIC_NNVM "Build a static nnvm lib" OFF)
option(USE_MSVC_MT "Build with MT" OFF)
# compile
if(MSVC)
add_definitions(-DDMLC_USE_CXX11)
add_definitions(-DDMLC_STRICT_CXX11)
foreach(flag_var
if (USE_MSVC_MT)
foreach(flag_var
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
if(${flag_var} MATCHES "/MD")
string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
endif(${flag_var} MATCHES "/MD")
endforeach(flag_var)
if(${flag_var} MATCHES "/MD")
string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
endif(${flag_var} MATCHES "/MD")
endforeach(flag_var)
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")
find_library(TVM_LIB tvm
HINTS ${CMAKE_CURRENT_SOURCE_DIR}/../tvm/build/Release
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment