Skip to content

Commit f81ee94

Browse files
authored
fallback for target load (#387)
1 parent eb9a90a commit f81ee94

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

cmake/aws-c-http-config.cmake

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,21 @@ include(CMakeFindDependencyMacro)
33
find_dependency(aws-c-io)
44
find_dependency(aws-c-compression)
55

6+
macro(aws_load_targets type)
7+
include(${CMAKE_CURRENT_LIST_DIR}/${type}/@[email protected])
8+
endmacro()
9+
10+
# try to load the lib follow BUILD_SHARED_LIBS. Fall back if not exist.
611
if (BUILD_SHARED_LIBS)
7-
include(${CMAKE_CURRENT_LIST_DIR}/shared/@[email protected])
12+
if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/shared")
13+
aws_load_targets(shared)
14+
else()
15+
aws_load_targets(static)
16+
endif()
817
else()
9-
include(${CMAKE_CURRENT_LIST_DIR}/static/@[email protected])
18+
if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/static")
19+
aws_load_targets(static)
20+
else()
21+
aws_load_targets(shared)
22+
endif()
1023
endif()
11-

0 commit comments

Comments
 (0)