<commit_before># Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

cmake_minimum_required(VERSION 3.6.0)

enable_language(ASM)

# Set as required by android-sources.cmake included below
set(BORINGSSL_ROOT ../third_party/boringssl/)

# Import sources as generated by tool/update-boringssl.py
# This provides variables, and requires BORINGSSL_ROOT to be set.
#  - crypto_sources
#  - crypto_sources_linux_aarch64
#  - crypto_sources_linux_arm
#  - crypto_sources_linux_ppc64le
#  - crypto_sources_linux_x86
#  - crypto_sources_linux_x86_64
include(
  ../third_party/boringssl/sources.cmake
)

# Tradeoff performance for smaller binary size, see:
# https://boringssl.googlesource.com/boringssl/+/HEAD/BUILDING.md#binary-size
add_definitions(-DOPENSSL_SMALL)

# Android ABIs, see also:
# https://developer.android.com/ndk/guides/abis
if(ANDROID_ABI STREQUAL "armeabi-v7a")
  set(crypto_sources_ARCH ${crypto_sources_linux_arm})
elseif ( ANDROID_ABI STREQUAL "arm64-v8a")
  set(crypto_sources_ARCH ${crypto_sources_linux_aarch64})
elseif ( ANDROID_ABI STREQUAL "x86")
  set(crypto_sources_ARCH ${crypto_sources_linux_x86})
elseif ( ANDROID_ABI STREQUAL "x86_64")
  set(crypto_sources_ARCH ${crypto_sources_linux_x86_64})
else()
  # If we can't match an architecture, we just disable assembler optimizations
  set(crypto_sources_ARCH)
  add_definitions(-DOPENSSL_NO_ASM)
endif()

add_library(
  webcrypto
  
  # Build a shared library
  SHARED
  
  # Source files
  ../src/webcrypto.c<commit_msg>Enabled LTO on android (#52)<commit_after># Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

cmake_minimum_required(VERSION 3.6.0)
project("webcrypto" LANGUAGES C)

enable_language(ASM)

# Set as required by android-sources.cmake included below
set(BORINGSSL_ROOT ../third_party/boringssl/)

# Import sources as generated by tool/update-boringssl.py
# This provides variables, and requires BORINGSSL_ROOT to be set.
#  - crypto_sources
#  - crypto_sources_linux_aarch64
#  - crypto_sources_linux_arm
#  - crypto_sources_linux_ppc64le
#  - crypto_sources_linux_x86
#  - crypto_sources_linux_x86_64
include(
  ../third_party/boringssl/sources.cmake
)

# Tradeoff performance for smaller binary size, see:
# https://boringssl.googlesource.com/boringssl/+/HEAD/BUILDING.md#binary-size
add_definitions(-DOPENSSL_SMALL)

# Enable link time optimization
set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -flto")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -flto")

# Android ABIs, see also:
# https://developer.android.com/ndk/guides/abis
if(ANDROID_ABI STREQUAL "armeabi-v7a")
  set(crypto_sources_ARCH ${crypto_sources_linux_arm})
elseif ( ANDROID_ABI STREQUAL "arm64-v8a")
  set(crypto_sources_ARCH ${crypto_sources_linux_aarch64})
elseif ( ANDROID_ABI STREQUAL "x86")
  set(crypto_sources_ARCH ${crypto_sources_linux_x86})
elseif ( ANDROID_ABI STREQUAL "x86_64")
  set(crypto_sources_ARCH ${crypto_sources_linux_x86_64})
else()
  # If we can't match an architecture, we just disable assembler optimizations
  set(crypto_sources_ARCH)
  add_definitions(-DOPENSSL_NO_ASM)
endif()

add_library(
  webcrypto
  
  # Build a shared library
  SHARED
  
  # Source files
  ../src/webcrypto.c
{'fraction_non_alphanumeric': 0.08761543926118873, 'fraction_numerical': 0.01894387875917594, 'mean_word_length': 5.193548387096774, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6501383', 'n_tokens_mistral': 1455, 'n_tokens_neox': 1385, 'n_words': 376}