fix the problem that there is no libxgboost.dll (#1674)

fix the problem that there is no libxgboost.dll built with Visual Studio.
This commit is contained in:
EQGM 2016-10-19 00:56:48 +08:00 committed by Tianqi Chen
parent 4b9d488387
commit d3fc815b45

View File

@ -74,9 +74,17 @@ add_subdirectory(dmlc-core)
add_library(rabit STATIC ${RABIT_SOURCES}) add_library(rabit STATIC ${RABIT_SOURCES})
if(MSVC)
add_executable(xgboost ${SOURCES})
add_library(libxgboost SHARED ${SOURCES})
target_link_libraries(xgboost dmlccore rabit)
target_link_libraries(libxgboost dmlccore rabit)
else()
add_executable(xgboost-bin ${SOURCES}) add_executable(xgboost-bin ${SOURCES})
SET_TARGET_PROPERTIES(xgboost-bin PROPERTIES OUTPUT_NAME xgboost) SET_TARGET_PROPERTIES(xgboost-bin PROPERTIES OUTPUT_NAME xgboost)
add_library(xgboost SHARED ${SOURCES}) add_library(xgboost SHARED ${SOURCES})
target_link_libraries(xgboost-bin dmlccore rabit) target_link_libraries(xgboost-bin dmlccore rabit)
target_link_libraries(xgboost dmlccore rabit) target_link_libraries(xgboost dmlccore rabit)
endif()