Enable building as shared library

This commit is contained in:
filipwasil
2016-05-15 15:47:55 +02:00
parent 00251e9a5b
commit 660cc22b74

View File

@@ -22,11 +22,14 @@ set(tinyobjloader-examples-objsticher
${TINYOBJLOADEREXAMPLES_DIR}/obj_sticher/obj_sticher.cc ${TINYOBJLOADEREXAMPLES_DIR}/obj_sticher/obj_sticher.cc
) )
add_library(tinyobjloader
${tinyobjloader-Source}
)
option(TINYOBJLOADER_BUILD_TEST_LOADER "Build Example Loader Application" OFF) option(TINYOBJLOADER_BUILD_TEST_LOADER "Build Example Loader Application" OFF)
option(TINYOBJLOADER_COMPILATION_SHARED "Build as shared library" OFF)
if (TINYOBJLOADER_COMPILATION_SHARED)
add_library(tinyobjloader SHARED ${tinyobjloader-Source})
else()
add_library(tinyobjloader STATIC ${tinyobjloader-Source})
endif()
if(TINYOBJLOADER_BUILD_TEST_LOADER) if(TINYOBJLOADER_BUILD_TEST_LOADER)
add_executable(test_loader ${tinyobjloader-Example-Source}) add_executable(test_loader ${tinyobjloader-Example-Source})