From 5c67669d105024c5ec84948207f80a01d3309887 Mon Sep 17 00:00:00 2001 From: liaogang Date: Mon, 26 Jun 2017 20:19:53 +0800 Subject: [PATCH] FIX: support shared type --- cmake/generic.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmake/generic.cmake b/cmake/generic.cmake index cc294c8c004..850c1868e68 100644 --- a/cmake/generic.cmake +++ b/cmake/generic.cmake @@ -274,7 +274,11 @@ function(go_library TARGET_NAME) # Add dummy code to support `make target_name` under Terminal Command set(dummyfile ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}_dummy.c) file(WRITE ${dummyfile} "const char * dummy = \"${dummyfile}\";") - add_library(${TARGET_NAME} STATIC ${dummyfile}) + if (go_library_SHARED OR go_library_shared) + add_library(${TARGET_NAME} SHARED ${dummyfile}) + else() + add_library(${TARGET_NAME} STATIC ${dummyfile}) + endif() if(go_library_DEPS) add_dependencies(${TARGET_NAME} ${go_library_DEPS}) endif(go_library_DEPS) -- GitLab