Skip to content

Add CMake build files #60

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 29 commits into from
Jan 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
16cd664
Add CMake build files
yim-lee Jan 19, 2021
84c5d33
Specify list of files for CCryptoBoringSSL
yim-lee Jan 20, 2021
2a842bd
Set BUILD_SHARED_LIBS
yim-lee Jan 22, 2021
ba7fad3
Set WIN32_LEAN_AND_MEAN
yim-lee Jan 22, 2021
5c1c060
don't install CCryptoBoringSSL
yim-lee Jan 22, 2021
10ef3bd
don't install CCryptoBoringSSLShims
yim-lee Jan 22, 2021
e7a3732
rename project
yim-lee Jan 22, 2021
638a69c
build: remove bleeding whitespace (NFC)
compnerd Jan 22, 2021
2f6c1ac
CCryptoBoringSSL: repair the Windows build
compnerd Jan 22, 2021
ad96913
remove my WIN32_LEAN_AND_MEAN change
yim-lee Jan 22, 2021
13951e6
build: explicitly propagate include paths
compnerd Jan 22, 2021
fd1eaab
CCryptoBoringSSL,CCryptoBoringSSLShims: add modulemaps
compnerd Jan 22, 2021
c47a205
Fix modulemap files
yim-lee Jan 22, 2021
5aa1ff2
Builds on ubuntu-focal
yim-lee Jan 22, 2021
b3fa911
Trying finding and linking CryptoKit on Apple platforms
yim-lee Jan 22, 2021
69512b9
Set '-fPIC' the correct way
yim-lee Jan 22, 2021
56c512e
build: build macOS against BoringSSL
compnerd Jan 22, 2021
bf80ab8
Fix check_no_api_breakages script
yim-lee Jan 23, 2021
2e0bae2
Script to update CMakeLists.txt
yim-lee Jan 25, 2021
d8a1295
Update gitignore per Saleem's feedback
yim-lee Jan 25, 2021
146f23b
Add code comment
yim-lee Jan 25, 2021
f73947a
Improved 'find'
yim-lee Jan 26, 2021
2f3091f
Add assembly files for Apple and Linux
yim-lee Jan 26, 2021
c2b84ba
Allow year 2021 in copyright header
yim-lee Jan 26, 2021
5b2e9c6
Add cmake files to license header check
yim-lee Jan 26, 2021
064a2cb
Add check for source file changes that would impact CMakeLists.txt
yim-lee Jan 26, 2021
9093150
Make sort consistent across platforms
yim-lee Jan 26, 2021
ace3765
Missing 'CMAKE_SYSTEM_PROCESSOR MATCHES' check
yim-lee Jan 27, 2021
4a1b864
Generate .S list
yim-lee Jan 27, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.DS_Store
/.build
/out
/Packages
/*.xcodeproj
Package.pins
Expand All @@ -13,3 +14,4 @@ DerivedData
**/gyb.pyc

.*.sw[nop]

43 changes: 43 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
##===----------------------------------------------------------------------===##
##
## This source file is part of the SwiftCrypto open source project
##
## Copyright (c) 2021 Apple Inc. and the SwiftCrypto project authors
## Licensed under Apache License v2.0
##
## See LICENSE.txt for license information
## See CONTRIBUTORS.md for the list of SwiftCrypto project authors
##
## SPDX-License-Identifier: Apache-2.0
##
##===----------------------------------------------------------------------===##

cmake_minimum_required(VERSION 3.15.1)

project(SwiftCrypto
LANGUAGES ASM C Swift)

list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)

include(SwiftSupport)

if(CMAKE_VERSION VERSION_LESS 3.16 AND CMAKE_SYSTEM_NAME STREQUAL Windows)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
else()
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
endif()
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_Swift_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/swift)

if(CMAKE_SYSTEM_NAME STREQUAL Windows OR CMAKE_SYSTEM_NAME STREQUAL Darwin)
option(BUILD_SHARED_LIBS "Build shared libraries by default" YES)
endif()

if(BUILD_SHARED_LIBS)
set(CMAKE_POSITION_INDEPENDENT_CODE YES)
endif()

add_subdirectory(Sources)
add_subdirectory(cmake/modules)
Loading