Skip to content

Commit

Permalink
Merge pull request #17 from awslabs/fix_mixed_builds
Browse files Browse the repository at this point in the history
fixed mixed shared/static builds in the same build closure.
  • Loading branch information
JonathanHenson authored Sep 14, 2019
2 parents 9f0e4f6 + ab50af1 commit 556f4fc
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,14 @@ configure_file("cmake/${CMAKE_PROJECT_NAME}-config.cmake"

install(FILES ${AWS_CAL_HEADERS} DESTINATION "include/aws/cal" COMPONENT Development)

if (BUILD_SHARED_LIBS)
set (TARGET_DIR "shared")
else()
set (TARGET_DIR "static")
endif()

install(EXPORT "${CMAKE_PROJECT_NAME}-targets"
DESTINATION "${LIBRARY_DIRECTORY}/${CMAKE_PROJECT_NAME}/cmake"
DESTINATION "${LIBRARY_DIRECTORY}/${CMAKE_PROJECT_NAME}/cmake/${TARGET_DIR}/"
NAMESPACE AWS::
COMPONENT Development)

Expand Down
7 changes: 6 additions & 1 deletion cmake/aws-c-cal-config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,9 @@ if (NOT BYO_CRYPTO AND NOT WIN32 AND NOT APPLE)
find_dependency(LibCrypto)
endif()

include(${CMAKE_CURRENT_LIST_DIR}/@[email protected])
if (BUILD_SHARED_LIBS)
include(${CMAKE_CURRENT_LIST_DIR}/shared/@[email protected])
else()
include(${CMAKE_CURRENT_LIST_DIR}/static/@[email protected])
endif()

4 changes: 3 additions & 1 deletion cmake/modules/FindLibCrypto.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ mark_as_advanced(
LibCrypto_STATIC_LIBRARY
)

if(LIBCRYPTO_FOUND)
if(LibCrypto_FOUND OR LIBCRYPTO_FOUND)
set(LibCrypto_FOUND true)
set(LIBCRYPTO_FOUND true)
message(STATUS "LibCrypto Include Dir: ${LibCrypto_INCLUDE_DIR}")
message(STATUS "LibCrypto Shared Lib: ${LibCrypto_SHARED_LIBRARY}")
message(STATUS "LibCrypto Static Lib: ${LibCrypto_STATIC_LIBRARY}")
Expand Down

0 comments on commit 556f4fc

Please sign in to comment.