From 45f953b0b32d19d740341d4afdfcebf5207b6d62 Mon Sep 17 00:00:00 2001 From: Rupal <56703525+rupal-bq@users.noreply.github.com> Date: Thu, 7 May 2020 17:15:30 -0700 Subject: [PATCH] Fix mac installer (#87) * remove RTTI * shared_libs * aws sdk static build for mac * update workflow for static build on mac * adding tag --- .github/workflows/main.yml | 4 ++-- aws_sdk_cpp_setup.sh | 16 ++-------------- src/CMakeLists.txt | 25 +++++++++++++++++-------- src/installer/CMakeLists.txt | 5 ----- 4 files changed, 21 insertions(+), 29 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 32f3c0df..b4aabb8e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -31,7 +31,7 @@ jobs: prefix_path=$(pwd) mkdir cmake-build cd cmake-build - cmake ../src -D CMAKE_INSTALL_PREFIX=$prefix_path/AWSSDK/ + cmake ../src -DCMAKE_INSTALL_PREFIX=$prefix_path/AWSSDK/ -DCMAKE_BUILD_TYPE=Release -DBUILD_ONLY="core" -DCUSTOM_MEMORY_MANAGEMENT="OFF" -DENABLE_RTTI="OFF" -DENABLE_TESTING="OFF" cd .. - name: build-driver run: | @@ -43,7 +43,7 @@ jobs: if: success() run: | cd cmake-build - cmake ../src -D CMAKE_INSTALL_PREFIX=$prefix_path/AWSSDK/ -D BUILD_WITH_TESTS=OFF + cmake ../src make cpack . cd .. diff --git a/aws_sdk_cpp_setup.sh b/aws_sdk_cpp_setup.sh index c69dd0c2..7ded1ee4 100755 --- a/aws_sdk_cpp_setup.sh +++ b/aws_sdk_cpp_setup.sh @@ -15,18 +15,6 @@ # permissions and limitations under the License. # -git clone "https://github.com/aws/aws-sdk-cpp.git" - -prefix_path=$(pwd) - -mkdir sdk-build - -cd sdk-build - -cmake ../aws-sdk-cpp/ -D CMAKE_INSTALL_PREFIX=$prefix_path/AWSSDK/ -D CMAKE_BUILD_TYPE=Release -D BUILD_ONLY="core" -D CUSTOM_MEMORY_MANAGEMENT="OFF" -D ENABLE_RTTI="OFF" -D ENABLE_TESTING="OFF" - -make - -make install - +cd src +git clone -b "1.7.329" "https://github.com/aws/aws-sdk-cpp.git" cd .. \ No newline at end of file diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b4fa0b54..7303f727 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -20,17 +20,21 @@ else() cmake_minimum_required(VERSION 3.13) endif() -# Use shared libraries, which is the default for the AWS C++ SDK build. -option(BUILD_SHARED_LIBS "Build shared libraries" ON) -# Set BUILD_WITH_TESTS to OFF before building installer package for size optimization. -option(BUILD_WITH_TESTS "Enable testing" ON) - project(global_make_list) # This wasn't being picked up on mac, causes some symbol errors if(APPLE) set(CMAKE_CXX_STANDARD 14) add_definitions(-DHAVE_STRLCAT) + # Do not use shared libraries for AWS SDK. + option(BUILD_SHARED_LIBS "Build shared libraries" OFF) + # Set BUILD_WITH_TESTS to OFF before building installer package for size optimization. + option(BUILD_WITH_TESTS "Enable testing" ON) +else() + # Use shared libraries for AWS SDK. + option(BUILD_SHARED_LIBS "Build shared libraries" ON) + # Set BUILD_WITH_TESTS to OFF before building installer package for size optimization. + option(BUILD_WITH_TESTS "Enable testing" ON) endif() if(MSVC) @@ -83,14 +87,16 @@ set(VLD_SRC ${LIBRARY_DIRECTORY}/VisualLeakDetector/include) # Without this symbols will be exporting to Unix but not Windows set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE) -set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) - # Set path for AWS SDK +set(aws-cpp-sdk-base "${CMAKE_CURRENT_SOURCE_DIR}/aws-sdk-cpp") set(aws-cpp-sdk-core_DIR "${PROJECT_ROOT}/AWSSDK/lib/cmake/aws-cpp-sdk-core") set(aws-c-event-stream_DIR "${PROJECT_ROOT}/AWSSDK/lib/aws-c-event-stream/cmake") set(aws-c-common_DIR "${PROJECT_ROOT}/AWSSDK/lib/aws-c-common/cmake") set(aws-checksums_DIR "${PROJECT_ROOT}/AWSSDK/lib/aws-checksums/cmake") -find_package(AWSSDK REQUIRED core) + +if (WIN32) + find_package(AWSSDK REQUIRED core) +endif() # General compiler definitions add_compile_definitions ( _SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING @@ -135,6 +141,9 @@ if(BUILD_WITH_TESTS) endif() # Projects to build +if (APPLE) + add_subdirectory(${aws-cpp-sdk-base}) +endif() add_subdirectory(${ODFEODBC_SRC}) add_subdirectory(${ODFEENLIST_SRC}) add_subdirectory(${INSTALL_SRC}) diff --git a/src/installer/CMakeLists.txt b/src/installer/CMakeLists.txt index 0c40d006..86abe1cf 100644 --- a/src/installer/CMakeLists.txt +++ b/src/installer/CMakeLists.txt @@ -112,11 +112,6 @@ if(WIN32) install(FILES "${PROJECT_ROOT}/AWSSDK/bin/aws-c-event-stream.dll" DESTINATION bin COMPONENT "Driver") install(FILES "${PROJECT_ROOT}/AWSSDK/bin/aws-checksums.dll" DESTINATION bin COMPONENT "Driver") install(FILES "${PROJECT_ROOT}/AWSSDK/bin/aws-cpp-sdk-core.dll" DESTINATION bin COMPONENT "Driver") -else() - install(FILES "${PROJECT_ROOT}/AWSSDK/lib/libaws-c-common.dylib" DESTINATION bin COMPONENT "Driver") - install(FILES "${PROJECT_ROOT}/AWSSDK/lib/libaws-c-event-stream.dylib" DESTINATION bin COMPONENT "Driver") - install(FILES "${PROJECT_ROOT}/AWSSDK/lib/libaws-checksums.dylib" DESTINATION bin COMPONENT "Driver") - install(FILES "${PROJECT_ROOT}/AWSSDK/lib/libaws-cpp-sdk-core.dylib" DESTINATION bin COMPONENT "Driver") endif() include(CPack)