1
0
mirror of https://github.com/fumiama/simple-protobuf.git synced 2026-06-08 18:10:28 +08:00

Update CMakeLists.txt

This commit is contained in:
源文雨
2021-06-08 19:58:34 +08:00
committed by GitHub
parent 8db2ae8e7d
commit 958d03697a

View File

@@ -8,6 +8,12 @@ if (${isBigEndian})
add_definitions(-DWORDS_BIGENDIAN)
endif()
#判断编译器类型,如果是gcc编译器,则在编译选项中加入c99支持
if(CMAKE_COMPILER_IS_GNUCXX)
add_compile_options(-std=c99)
message(STATUS "optional:-std=c99")
endif(CMAKE_COMPILER_IS_GNUCXX)
add_library(spb SHARED protobuf.c)
add_library(spb_static STATIC protobuf.c)
set_target_properties(spb_static PROPERTIES OUTPUT_NAME spb)
@@ -16,4 +22,4 @@ target_link_libraries(t spb)
INSTALL(TARGETS spb LIBRARY DESTINATION lib)
INSTALL(TARGETS spb_static ARCHIVE DESTINATION lib)
INSTALL(FILES simple_protobuf.h DESTINATION include)
INSTALL(FILES simple_protobuf.h DESTINATION include)