Used consistent wording for HotPocket.

This commit is contained in:
ravinsp
2023-05-07 14:08:55 +05:30
parent 9b864ad1e8
commit 33e536c31b
20 changed files with 52 additions and 53 deletions

View File

@@ -1,11 +1,11 @@
###
# ##
# Compile-time timestamping library
#
#
# Adapted from https://github.com/kraiskil/cmake_timestamp
# This is only used for the Hot Pocket kill switch.
# This is only used for the HotPocket kill switch.
#CMake 3.12 made using OBJECT libraries much nicer, so we use that.
# CMake 3.12 made using OBJECT libraries much nicer, so we use that.
cmake_minimum_required(VERSION 3.12)
# Set CMake variable BUILD_TIME to 'now'. This 'now' is the time
@@ -13,26 +13,25 @@ cmake_minimum_required(VERSION 3.12)
string(TIMESTAMP BUILD_TIME "%s" UTC)
# Compile the library that contains the global variables
add_library( killswitch OBJECT killswitch.c)
add_library(killswitch OBJECT killswitch.c)
target_compile_definitions(
killswitch
PRIVATE -DBUILD_TIME="${BUILD_TIME}"
)
target_include_directories( killswitch
target_include_directories(killswitch
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
)
#Add a dummy target that removes the CMake variable BUILD_TIME from CMake's cache.
#this forces CMake to be-rerun when we hit this target.
# Add a dummy target that removes the CMake variable BUILD_TIME from CMake's cache.
# this forces CMake to be-rerun when we hit this target.
add_custom_target(
clear_cache
COMMAND ${CMAKE_COMMAND} -U BUILD_TIME ${CMAKE_BINARY_DIR}
)
#Have the cache clearing be run before trying to build the killswitch library.
#This (I think) is the same as a PRE_BUILD custom_command. But PRE_BUILD is
#available for VS generators only, on others it is synonymous to PRE_LINK,
#i.e. "post compile"
# Have the cache clearing be run before trying to build the killswitch library.
# This (I think) is the same as a PRE_BUILD custom_command. But PRE_BUILD is
# available for VS generators only, on others it is synonymous to PRE_LINK,
# i.e. "post compile"
add_dependencies(killswitch clear_cache)

View File

@@ -9,7 +9,7 @@ uint64_t build_time_sec = 0;
/**
* Returns true if kill switch is activated (allowed time has expired).
* Otherwise returns false (can keep using Hot Pocket).
* Otherwise returns false (can keep using HotPocket).
* @param epoch_ms Current time in epoch milliseconds.
*/
bool kill_switch(const uint64_t epoch_ms)

View File

@@ -1,4 +1,4 @@
Based on https://github.com/kraiskil/cmake_timestamp
This whole folder exists to get the CMAKE compile/link time into the binary so we can perform
Hot Pocket time-based kill switch check. This folder must be removed when we no longer need the kill switch.
HotPocket time-based kill switch check. This folder must be removed when we no longer need the kill switch.