Skip to content

Commit

Permalink
add use_mt option, default to use md as mt won't work with current c+…
Browse files Browse the repository at this point in the history
…+ api (apache#484)
  • Loading branch information
souptc authored and sergei-mironov committed Aug 8, 2018
1 parent a27c186 commit 87405ca
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions nnvm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 87405ca

Please sign in to comment.