Skip to content

Commit

Permalink
Update required CMake
Browse files Browse the repository at this point in the history
  • Loading branch information
graebm committed Aug 19, 2024
1 parent bf2dcbd commit 53a4465
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 19 deletions.
2 changes: 1 addition & 1 deletion AWSCRTAndroidTestRunner/app/src/main/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# Sets the minimum version of CMake required to build the native library.

cmake_minimum_required(VERSION 3.4.1)
cmake_minimum_required(VERSION 3.13)

# AWS lib
set(path_to_common "${CMAKE_CURRENT_LIST_DIR}/../../../../..")
Expand Down
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0.

cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 3.13)
option(ALLOW_CROSS_COMPILED_TESTS "Allow tests to be compiled via cross compile, for use with qemu" OFF)

project(aws-c-common LANGUAGES C VERSION 0.1.0)
Expand Down Expand Up @@ -181,7 +181,6 @@ file(GLOB COMMON_SRC
${AWS_COMMON_EXTERNAL_SRC}
)

aws_set_common_policies()
add_library(${PROJECT_NAME} ${COMMON_SRC})
aws_set_common_properties(${PROJECT_NAME} NO_WEXTRA)
aws_prepare_symbol_visibility_args(${PROJECT_NAME} "AWS_COMMON")
Expand Down
17 changes: 1 addition & 16 deletions cmake/AwsCFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,6 @@ function(aws_check_posix_lfs extra_flags variable)
endif()
endfunction()

# This function sets common CMake policies.
# Call this before calling add_library() or add_executable().
function(aws_set_common_policies)
# Enable LTO/IPO if available in the compiler
if (POLICY CMP0069)
cmake_policy(SET CMP0069 NEW)
endif()

# Honor visibility properties for all target types
if (POLICY CMP0063)
cmake_policy(SET CMP0063 NEW)
endif()
endfunction()

# This function will set all common flags on a target
# Options:
# NO_WGNU: Disable -Wgnu
Expand Down Expand Up @@ -183,8 +169,7 @@ function(aws_set_common_properties target)
# If the symbols from libcrypto.a aren't hidden, then SOME function calls use the libcrypto.a implementation
# and SOME function calls use the libcrypto.so implementation, and this mismatch leads to weird crashes.
if (UNIX AND NOT APPLE)
# If we used target_link_options() (CMake 3.13+) we could make these flags PUBLIC
set_property(TARGET ${target} APPEND_STRING PROPERTY LINK_FLAGS " -Wl,--exclude-libs,libcrypto.a")
target_link_options(${target} PUBLIC "LINKER:--exclude-libs,libcrypto.a")
endif()

endif()
Expand Down

0 comments on commit 53a4465

Please sign in to comment.