diff options
author | David Benjamin <davidben@google.com> | 2024-03-18 15:37:24 +1000 |
---|---|---|
committer | Boringssl LUCI CQ <boringssl-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2024-03-22 05:15:56 +0000 |
commit | fe0c91e74481e335f434dd6403eeb7ce160fe18d (patch) | |
tree | fa575ae782d0c46e9733017c7b57a14cc33c0d01 /CMakeLists.txt | |
parent | 36e85b6a05fe185f6b3a1b7e609e8b775c9b5a81 (diff) | |
download | boringssl-fe0c91e74481e335f434dd6403eeb7ce160fe18d.zip boringssl-fe0c91e74481e335f434dd6403eeb7ce160fe18d.tar.gz boringssl-fe0c91e74481e335f434dd6403eeb7ce160fe18d.tar.bz2 |
Check in pre-generated perlasm and error data files
This adds a tool for managing pre-generated files, aligning our CMake
and non-CMake builds. The plan is roughly:
The source of truth for the file lists will (eventually) be build.json.
This describes the build in terms of the files that we directly edit.
However, we have a two-phase build. First a pregeneration step
transforms some of the less convenient inputs into checked in files.
Notably perlasm files get expanded. This produces an equivalent JSON
structure with fewer inputs. The same tool then outputs that structure
into whatever build systems we want.
This initial version pre-generates err_data.c and perlasm files. I've
not wired up the various build formats, except for CMake (for the CMake
build to consume) and JSON (for generate_build_files.py to parse).
build.json is also, for now, only a subset of the build. Later changes
The upshot of all this is we no longer have a Perl build dependency!
Perl is now only needed when working on BoringSSL. It nearly removes the
Go one, but Go is still needed to run and (for now) build the tests.
To keep the generated files up-to-date, once this lands, I'll update our
CI to run `go run ./util/pregenerate -check` which asserts that all
generated files are correct. From there we can land the later changes in
this patch series that uses this more extensively. My eventual goal is
to replace generate_build_files.py altogether and the
"master-with-bazel" branch. Instead we'll just have sources.bzl,
sources.gni, etc. all checked into the tree directly. And then the
normal branch will just have both a CMake and Bazel build in it.
Update-Note: generate_build_files.py no longer generates assembly files
or err_data.c. Those are now checked into the tree directly.
Bug: 542
Change-Id: I71f5ff7417be811f8b7888b345279474e6b38ee9
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/67288
Reviewed-by: Bob Beck <bbe@google.com>
Commit-Queue: David Benjamin <davidben@google.com>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 59623e0..1410c43 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,7 +18,7 @@ endif() include(sources.cmake) include(cmake/go.cmake) include(cmake/paths.cmake) -include(cmake/perlasm.cmake) +include(gen/sources.cmake) enable_language(C) enable_language(CXX) @@ -43,8 +43,6 @@ function(install_if_enabled) endif() endfunction() -find_package(Perl REQUIRED) - if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND NOT CMAKE_CROSSCOMPILING) find_package(PkgConfig QUIET) if (PkgConfig_FOUND) @@ -530,7 +528,13 @@ add_library(decrepit ${DECREPIT_SOURCES}) target_link_libraries(decrepit crypto ssl) add_library(test_support_lib STATIC ${TEST_SUPPORT_SOURCES}) -if (LIBUNWIND_FOUND) +if(OPENSSL_ASM) + target_sources(test_support_lib PRIVATE ${TEST_SUPPORT_SOURCES_ASM}) +endif() +if(OPENSSL_NASM) + target_sources(test_support_lib PRIVATE ${TEST_SUPPORT_SOURCES_NASM}) +endif() +if(LIBUNWIND_FOUND) target_compile_options(test_support_lib PRIVATE ${LIBUNWIND_CFLAGS_OTHER}) target_include_directories(test_support_lib PRIVATE ${LIBUNWIND_INCLUDE_DIRS}) target_link_libraries(test_support_lib ${LIBUNWIND_LDFLAGS}) |