Skip to content

Commit

Permalink
Improve message when repo submods not initialized
Browse files Browse the repository at this point in the history
  • Loading branch information
justsmth committed Jan 6, 2025
1 parent c5e6879 commit 36e5159
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
3 changes: 3 additions & 0 deletions aws-lc-fips-sys/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ if (BUILD_SHARED_LIBS AND FIPS)
endif()

add_subdirectory(aws-lc aws-lc EXCLUDE_FROM_ALL)
if(NOT EXISTS aws-lc/CMakeLists.txt)
message(WARNING "###### WARNING: MISSING GIT SUBMODULE ###### Did you initialize the repo's git submodules? CMakeLists.txt not found.")
endif()

if (BUILD_LIBSSL)
add_definitions(-DAWS_LC_RUST_INCLUDE_SSL)
Expand Down
3 changes: 3 additions & 0 deletions aws-lc-sys/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ if(BUILD_SHARED_LIBS)
endif()

add_subdirectory(aws-lc aws-lc EXCLUDE_FROM_ALL)
if(NOT EXISTS aws-lc/CMakeLists.txt)
message(WARNING "###### WARNING: MISSING GIT SUBMODULE ###### Did you initialize the repo's git submodules? CMakeLists.txt not found.")
endif()

if (BUILD_LIBSSL)
add_definitions(-DAWS_LC_RUST_INCLUDE_SSL)
Expand Down
20 changes: 13 additions & 7 deletions aws-lc-sys/builder/cc_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,14 +267,20 @@ impl CcBuilder {
let mut ret_val = false;
let output_dir = self.out_dir.join(format!("out-{basename}"));
let mut cc_build = self.create_builder();
let source_file = self
.manifest_dir
.join("aws-lc")
.join("tests")
.join("compiler_features_tests")
.join(format!("{basename}.c"));
if !source_file.exists() {
emit_warning(&format!(
"###### WARNING: MISSING GIT SUBMODULE ###### Did you initialize the repo's git submodules? Unable to find source file: {:?}.",
&source_file
));
}
cc_build
.file(
self.manifest_dir
.join("aws-lc")
.join("tests")
.join("compiler_features_tests")
.join(format!("{basename}.c")),
)
.file(source_file)
.warnings_into_errors(true)
.out_dir(&output_dir);

Expand Down

0 comments on commit 36e5159

Please sign in to comment.