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,11 +31,13 @@ add_definitions(-DNNVM_EXPORTS) ...@@ -31,11 +31,13 @@ add_definitions(-DNNVM_EXPORTS)
# Build a shared lib (libnnvm.so) by default # Build a shared lib (libnnvm.so) by default
option(BUILD_SHARED_NNVM "Build a shared nnvm lib" ON) option(BUILD_SHARED_NNVM "Build a shared nnvm lib" ON)
option(BUILD_STATIC_NNVM "Build a static nnvm lib" OFF) option(BUILD_STATIC_NNVM "Build a static nnvm lib" OFF)
option(USE_MSVC_MT "Build with MT" OFF)
# compile # compile
if(MSVC) if(MSVC)
add_definitions(-DDMLC_USE_CXX11) add_definitions(-DDMLC_USE_CXX11)
add_definitions(-DDMLC_STRICT_CXX11) add_definitions(-DDMLC_STRICT_CXX11)
if (USE_MSVC_MT)
foreach(flag_var foreach(flag_var
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO) CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
...@@ -43,6 +45,7 @@ if(MSVC) ...@@ -43,6 +45,7 @@ if(MSVC)
string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}") string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
endif(${flag_var} MATCHES "/MD") endif(${flag_var} MATCHES "/MD")
endforeach(flag_var) endforeach(flag_var)
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")
find_library(TVM_LIB tvm find_library(TVM_LIB tvm
HINTS ${CMAKE_CURRENT_SOURCE_DIR}/../tvm/build/Release 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