gen-zam: Remove submodule, adapt CMake configuration for Zeek build

This commit is contained in:
Tim Wojtulewicz 2025-08-17 21:01:06 -07:00
parent 526238299d
commit a2f4f2adc3
6 changed files with 6 additions and 41 deletions

3
.gitmodules vendored
View file

@ -40,9 +40,6 @@
[submodule "auxil/zeek-client"]
path = auxil/zeek-client
url = https://github.com/zeek/zeek-client
[submodule "auxil/gen-zam"]
path = auxil/gen-zam
url = https://github.com/zeek/gen-zam
[submodule "auxil/c-ares"]
path = auxil/c-ares
url = https://github.com/c-ares/c-ares

View file

@ -912,7 +912,7 @@ set(BIFCL_EXE_PATH "${CMAKE_BINARY_DIR}/tools/bifcl/bifcl${CMAKE_EXECUTABLE_SUFF
set(_bifcl_exe_path "included")
if (NOT GEN_ZAM_EXE_PATH)
add_subdirectory(auxil/gen-zam)
add_subdirectory(tools/gen-zam)
endif ()
if (ENABLE_JEMALLOC)

@ -1 +0,0 @@
Subproject commit 56a6db00b887c79d26f303676677cb490d1c296d

View file

@ -1,33 +1,2 @@
cmake_minimum_required(VERSION 3.15 FATAL_ERROR)
project(Gen-ZAM C CXX)
include(cmake/CommonCMakeConfig.cmake)
include(RequireCXXStd)
set(GEN_ZAM_SRCS src/Gen-ZAM.cc)
set(GEN_ZAM_HEADERS src/Gen-ZAM.h)
add_executable(gen-zam ${GEN_ZAM_SRCS} ${GEN_ZAM_HEADERS})
install(TARGETS gen-zam DESTINATION bin)
if (CMAKE_BUILD_TYPE)
string(TOUPPER ${CMAKE_BUILD_TYPE} BuildType)
endif ()
message(
"\n===================| Gen-ZAM Build Summary |==================\n"
"\n"
"\nBuild type: ${CMAKE_BUILD_TYPE}"
"\nBuild dir: ${PROJECT_BINARY_DIR}"
"\nInstall prefix: ${CMAKE_INSTALL_PREFIX}"
"\nDebug mode: ${ENABLE_DEBUG}"
"\n"
"\nCC: ${CMAKE_C_COMPILER}"
"\nCFLAGS: ${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${BuildType}}"
"\nCXX: ${CMAKE_CXX_COMPILER}"
"\nCXXFLAGS: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${BuildType}}"
"\nCPP: ${CMAKE_CXX_COMPILER}"
"\n"
"\n================================================================\n")
include(UserChangedWarning)
add_executable(gen-zam)
target_sources(gen-zam PRIVATE src/Gen-ZAM.cc)

View file

@ -136,7 +136,7 @@ ArgsManager::ArgsManager(const OCVec& oc_orig, ZAM_InstClass zc) {
void ArgsManager::Differentiate() {
// First, figure out which parameter names are used how often.
map<string, int> name_count; // how often the name apepars
map<string, int> name_count; // how often the name appears
map<string, int> usage_count; // how often the name's been used so far
for ( auto& arg : args ) {
auto& name = arg.param_name;

View file

@ -367,7 +367,7 @@ protected:
// An "assignment-less" operation is one that, if its result
// is used in a dead assignment, should be converted to a different
// operation that explictly omits any assignment.
// operation that explicitly omits any assignment.
bool HasAssignmentLess() const { return ! assignment_less_op.empty(); }
void SetAssignmentLess(string op, string op_class) {
assignment_less_op = std::move(op);
@ -515,7 +515,7 @@ protected:
IndentDown();
}
// Start/finish emiting a (likely multi-line) string literal -
// Start/finish emitting a (likely multi-line) string literal -
// see corresponding ZAMGen methods.
void StartString();
void EndString();