* fbt: fixed include paths for generated version header * lib: STM32CubeWB: refactored & cleaned up WPAN include paths * hal: linter fixes for new headers * fbt: added version_json target * Added .pvsconfig; split common_defines.h into 2 files * Added PVS-Studio basic configuration files; updated .gitignore Co-authored-by: あく <alleteam@gmail.com>
		
			
				
	
	
		
			49 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			49 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			Python
		
	
	
	
	
	
Import("env")
 | 
						|
 | 
						|
from fbt.version import get_fast_git_version_id
 | 
						|
 | 
						|
 | 
						|
env.Append(
 | 
						|
    CPPPATH=[
 | 
						|
        "#/lib/toolbox",
 | 
						|
    ],
 | 
						|
)
 | 
						|
 | 
						|
 | 
						|
libenv = env.Clone(tools=["fbt_version"], FW_LIB_NAME="toolbox")
 | 
						|
libenv.ApplyLibFlags()
 | 
						|
 | 
						|
 | 
						|
# Git Version management
 | 
						|
version_depends = []
 | 
						|
version_id_data = get_fast_git_version_id()
 | 
						|
if version_id_data:
 | 
						|
    version_depends = Value(version_id_data)
 | 
						|
 | 
						|
# Only invoke version generator if preliminary check target (version_depends) has changed
 | 
						|
build_version = libenv.VersionBuilder(
 | 
						|
    Dir("."),
 | 
						|
    version_depends,
 | 
						|
)
 | 
						|
 | 
						|
fw_version_json = libenv.InstallAs(
 | 
						|
    "${BUILD_DIR}/${FIRMWARE_BUILD_CFG}.json", "version.json"
 | 
						|
)
 | 
						|
Alias("version_json", fw_version_json)
 | 
						|
env.Append(FW_VERSION_JSON=fw_version_json)
 | 
						|
 | 
						|
# Default(fw_version_json)
 | 
						|
 | 
						|
 | 
						|
if not version_depends:
 | 
						|
    libenv.Precious(build_version)
 | 
						|
    libenv.AlwaysBuild(build_version)
 | 
						|
 | 
						|
sources = libenv.GlobRecursive("*.c")
 | 
						|
 | 
						|
libenv.Append(CPPPATH=[libenv.Dir(".")])
 | 
						|
 | 
						|
lib = libenv.StaticLibrary("${FW_LIB_NAME}", sources)
 | 
						|
libenv.Install("${LIB_DIST_DIR}", lib)
 | 
						|
Return("lib")
 |