mirror of
https://github.com/zeek/zeek.git
synced 2025-10-06 00:28:21 +00:00
Allow faster rebuilds in certain cases
Previously, when rebuilding with a different "--prefix" or "--scriptdir", all Bro source files were recompiled. With this change, only util.cc is recompiled. Instead of specifying command-line preprocessor macros on all source files, a header file is regenerated when needed which only util.cc includes.
This commit is contained in:
parent
5e12a53ae5
commit
15033a2b62
3 changed files with 5 additions and 4 deletions
|
@ -4,6 +4,7 @@ include_directories(BEFORE
|
||||||
)
|
)
|
||||||
|
|
||||||
configure_file(version.c.in ${CMAKE_CURRENT_BINARY_DIR}/version.c)
|
configure_file(version.c.in ${CMAKE_CURRENT_BINARY_DIR}/version.c)
|
||||||
|
configure_file(util-config.h.in ${CMAKE_CURRENT_BINARY_DIR}/util-config.h)
|
||||||
|
|
||||||
# This creates a custom command to transform a bison output file (inFile)
|
# This creates a custom command to transform a bison output file (inFile)
|
||||||
# into outFile in order to avoid symbol conflicts:
|
# into outFile in order to avoid symbol conflicts:
|
||||||
|
@ -444,10 +445,6 @@ set(bro_SRCS
|
||||||
|
|
||||||
collect_headers(bro_HEADERS ${bro_SRCS})
|
collect_headers(bro_HEADERS ${bro_SRCS})
|
||||||
|
|
||||||
add_definitions(-DBRO_SCRIPT_INSTALL_PATH="${BRO_SCRIPT_INSTALL_PATH}")
|
|
||||||
add_definitions(-DBRO_SCRIPT_SOURCE_PATH="${BRO_SCRIPT_SOURCE_PATH}")
|
|
||||||
add_definitions(-DBRO_BUILD_PATH="${CMAKE_CURRENT_BINARY_DIR}")
|
|
||||||
|
|
||||||
add_executable(bro ${bro_SRCS} ${bro_HEADERS})
|
add_executable(bro ${bro_SRCS} ${bro_HEADERS})
|
||||||
|
|
||||||
target_link_libraries(bro ${brodeps} ${CMAKE_THREAD_LIBS_INIT})
|
target_link_libraries(bro ${brodeps} ${CMAKE_THREAD_LIBS_INIT})
|
||||||
|
|
3
src/util-config.h.in
Normal file
3
src/util-config.h.in
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
#define BRO_SCRIPT_INSTALL_PATH "@BRO_SCRIPT_INSTALL_PATH@"
|
||||||
|
#define BRO_SCRIPT_SOURCE_PATH "@BRO_SCRIPT_SOURCE_PATH@"
|
||||||
|
#define BRO_BUILD_PATH "@CMAKE_CURRENT_BINARY_DIR@"
|
|
@ -1,6 +1,7 @@
|
||||||
// See the file "COPYING" in the main distribution directory for copyright.
|
// See the file "COPYING" in the main distribution directory for copyright.
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
#include "util-config.h"
|
||||||
|
|
||||||
#ifdef TIME_WITH_SYS_TIME
|
#ifdef TIME_WITH_SYS_TIME
|
||||||
# include <sys/time.h>
|
# include <sys/time.h>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue