Skip to content

Commit 71d74d4

Browse files
author
Tom Seddon
committed
build: add llhttp-specific prefix to CMake options.
BUILD_SHARED_LIBS is now called LLHTTP_BUILD_SHARED_LIBS. BUILD_STATIC_LIBS is now called LLHTTP_BUILD_STATIC_LIBS. CMake options have global scope so there's the risk of conflict otherwise. For example, libcurl has a BUILD_STATIC_LIBS option too. Documentation updates to be discussed. See #647
1 parent 6d2ecf2 commit 71d74d4

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

CMakeLists.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ endif()
2424
# Options
2525
#
2626
# Generic option
27-
option(BUILD_SHARED_LIBS "Build shared libraries (.dll/.so)" ON)
28-
option(BUILD_STATIC_LIBS "Build static libraries (.lib/.a)" OFF)
27+
option(LLHTTP_BUILD_SHARED_LIBS "Build shared libraries (.dll/.so)" ON)
28+
option(LLHTTP_BUILD_STATIC_LIBS "Build static libraries (.lib/.a)" OFF)
2929

3030
# Source code
3131
set(LLHTTP_SOURCES
@@ -80,19 +80,19 @@ function(config_library target)
8080
)
8181
endfunction(config_library target)
8282

83-
if(BUILD_SHARED_LIBS)
83+
if(LLHTTP_BUILD_SHARED_LIBS)
8484
add_library(llhttp_shared SHARED
8585
${llhttp_src}
8686
)
8787
add_library(llhttp::llhttp ALIAS llhttp_shared)
8888
config_library(llhttp_shared)
8989
endif()
9090

91-
if(BUILD_STATIC_LIBS)
91+
if(LLHTTP_BUILD_STATIC_LIBS)
9292
add_library(llhttp_static STATIC
9393
${llhttp_src}
9494
)
95-
if(BUILD_SHARED_LIBS)
95+
if(LLHTTP_BUILD_SHARED_LIBS)
9696
add_library(llhttp::llhttp ALIAS llhttp_shared)
9797
else()
9898
add_library(llhttp::llhttp ALIAS llhttp_static)
@@ -113,6 +113,6 @@ message(STATUS "Project configure summary:")
113113
message(STATUS "")
114114
message(STATUS " CMake build type .................: ${CMAKE_BUILD_TYPE}")
115115
message(STATUS " Install prefix ...................: ${CMAKE_INSTALL_PREFIX}")
116-
message(STATUS " Build shared library .............: ${BUILD_SHARED_LIBS}")
117-
message(STATUS " Build static library .............: ${BUILD_STATIC_LIBS}")
116+
message(STATUS " Build shared library .............: ${LLHTTP_BUILD_SHARED_LIBS}")
117+
message(STATUS " Build static library .............: ${LLHTTP_BUILD_STATIC_LIBS}")
118118
message(STATUS "")

0 commit comments

Comments
 (0)