Skip to content

Commit

Permalink
Add AWS-LC src & ref flags to Gradle build (#390)
Browse files Browse the repository at this point in the history
  • Loading branch information
sp717 authored Jul 2, 2024
1 parent d7a87fa commit f505960
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ if (ext.isFips) {
} else {
ext.awsLcGitVersionId = 'v1.30.1'
}

// Check for user inputted git version ID.
if (System.properties["AWSLC_GITVERSION"]) {
ext.awsLcGitVersionId = System.properties["AWSLC_GITVERSION"]
}

ext.isLegacyBuild = Boolean.getBoolean('LEGACY_BUILD')

ext.lcovIgnore = System.properties['LCOV_IGNORE']
Expand Down Expand Up @@ -90,6 +96,11 @@ def getClangFormatVersion() {

def awslcSrcPath = "${projectDir}/aws-lc/"

// Check for user inputted AWS-LC source directory.
if (System.properties["AWSLC_SRC_DIR"]) {
awslcSrcPath = System.properties["AWSLC_SRC_DIR"]
}

// Execute cmake3 command to see if it exists. Mainly to support AL2.
def detect_cmake3 = {
def exec_cmake3 = exec {
Expand Down Expand Up @@ -174,7 +185,11 @@ task buildAwsLc {

doFirst {
if (file(awslcSrcPath).list().size() == 0) {
throw new GradleException("aws-lc dir empty! run 'git submodule update --init --recursive' to populate.")
if (System.properties["AWSLC_SRC_DIR"]) {
throw new GradleException("aws-lc dir empty! specify another directory or populate with aws-lc source files.")
} else {
throw new GradleException("aws-lc dir empty! run 'git submodule update --init --recursive' to populate.")
}
}

if (!isLegacyBuild) {
Expand Down

0 comments on commit f505960

Please sign in to comment.