Unverified Commit 2e2757f1 authored by Darby Payne's avatar Darby Payne Committed by GitHub
Browse files

Adding static library option (#3171)

parent be85f56f
...@@ -14,6 +14,7 @@ OPTION(USE_HDFS "Enable HDFS support (EXPERIMENTAL)" OFF) ...@@ -14,6 +14,7 @@ OPTION(USE_HDFS "Enable HDFS support (EXPERIMENTAL)" OFF)
OPTION(USE_R35 "Set to ON if your R version is not earlier than 3.5" OFF) OPTION(USE_R35 "Set to ON if your R version is not earlier than 3.5" OFF)
OPTION(USE_TIMETAG "Set to ON to output time costs" OFF) OPTION(USE_TIMETAG "Set to ON to output time costs" OFF)
OPTION(USE_DEBUG "Set to ON for Debug mode" OFF) OPTION(USE_DEBUG "Set to ON for Debug mode" OFF)
option(BUILD_STATIC_LIB "Build static library" OFF)
OPTION(BUILD_FOR_R "Set to ON if building lib_lightgbm for use with the R package" OFF) OPTION(BUILD_FOR_R "Set to ON if building lib_lightgbm for use with the R package" OFF)
if(APPLE) if(APPLE)
...@@ -243,7 +244,11 @@ if(BUILD_FOR_R) ...@@ -243,7 +244,11 @@ if(BUILD_FOR_R)
list(APPEND SOURCES "src/lightgbm_R.cpp") list(APPEND SOURCES "src/lightgbm_R.cpp")
endif(BUILD_FOR_R) endif(BUILD_FOR_R)
add_library(_lightgbm SHARED ${SOURCES}) if (BUILD_STATIC_LIB)
add_library(_lightgbm STATIC ${SOURCES})
else()
add_library(_lightgbm SHARED ${SOURCES})
endif(BUILD_STATIC_LIB)
if(MSVC) if(MSVC)
set_target_properties(_lightgbm PROPERTIES OUTPUT_NAME "lib_lightgbm") set_target_properties(_lightgbm PROPERTIES OUTPUT_NAME "lib_lightgbm")
......
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