本文作者原创,首发在本博客;CSDN 上的同名文章已标注为转载并回链到本页:https://blog.csdn.net/qq_30220519/article/details/139013075
windows
- orbit
- qcachegrind+graphviz+verysleepy
- gperf issues
- 头文件include优化,include-what-you-use.exe
- wincachegrind
linux
- oprofile
- kprof
创作不易, 小小的支持一下吧!


本文作者原创,首发在本博客;CSDN 上的同名文章已标注为转载并回链到本页:https://blog.csdn.net/qq_30220519/article/details/139013075


本文作者原创,首发在本博客;CSDN 上的同名文章已标注为转载并回链到本页:https://blog.csdn.net/qq_30220519/article/details/139010523
mkdir build && cd build
cmake -DCMAKE_CXX_COMPILER=”%VCINSTALLDIR%/bin/cl.exe” -DCMAKE_CXX_INCLUDE_WHAT_YOU_USE=”/mnt/include-what-you-use/build/bin/include-what-you-use” -G Ninja ..
export IWYU_BINARY=/mnt/include-what-you-use/build/bin/include-what-you-use
python3 /mnt/include-what-you-use/iwyu_tool.py -j 8 -p .> iwyu.out
python3 /mnt/include-what-you-use/fix_includes.py -b –comments –update_comments < iwyu.out
clang -pg -lstdc++ -o ./cmake/test ./cmake/cmake.cpp -lc_p
./cmake/test
gprof -b -qfunc1 fic_untilTool_test gmon.out>gmon.txt
gprof -b test gmon.out -Ffunc1 -efuncTest >gmon.txt
kprof -f ./test
gprof ./test | gprof2dot.py | xdot
-b 不显示描述
-A 显示函数源码
-pa 只打印a的flat profile,-Pa只屏蔽a
-qa 只打印a的call,-Qa只屏蔽a
sprof ./module.so Perf.profile -p >log.txt
time ./program
gcov ./summer-proj覆盖测试
gprof ./Perf | gprof2dot.py | dot -Tpng -o output.png
cd gprof2dot && cat ../bin/gmon.txt | python3 gprof2dot.py -n0 -e0 | dot -Tpdf -o output.pdf
编译开关-ftest-coverage -fprofile-arcs
改run.sh 换行类型
apt-get install ./libimagequant0_2.12.2-1.1_amd64.deb
apt-get install ./libimagequant-dev_2.12.2-1.1_amd64.deb
dpkg-deb -c quantum6.deb
泄露分析,编译链接-g
valgrind –tool=memcheck –leak-check=full –show-leak-kinds=all ./bin/Perf
valgrind –tool=callgrind ../bin/Perf
python gprof2dot.py -f callgrind -n10 -s callgrind.out.31113 | dot -Tpng -o valgrind.png
pprof安装
export CPUPROFILE_FREQUENCY=1
go install github.com/google/pprof@latest
pprof –text ./Perf test_capture.prof > profile.txt
pprof –callgrind ./Perf test_capture.prof > callgrind.res
pprof ./Perf test_capture.prof –web
pprof ./Perf test_capture.prof –pdf > prof.pdf
查看-pg是否生效
-lc_p
nm libobjectmodule.so | grep mcount
ldd ./Perf | grep libc
apt-get install libpopt-dev
apt-get install libiberty-dev
apt-get install libfdt-dev
#Recommended profilers¶
VerySleepy (Windows only)
HotSpot (Linux only)
Xcode Instruments (macOS only)


本文作者原创,首发在本博客;CSDN 上的同名文章已标注为转载并回链到本页:https://blog.csdn.net/qq_30220519/article/details/138975456
GitHub - Meidozuki/VBAO: A library aiming for building an MVVM (or MVFM) project
https://github.com/Btk-Project/xmake-repo
GitHub - tboox/gbox: 🎨 A multi-platform graphic library
GitHub - tboox/vm86: 🍔 A x86 Script Instruction Virtual Machine
GitHub - tboox/ltui: 🍖 A cross-platform terminal ui library based on Lua
#https://xmake.io/#/guide/faq?id=breakpoint-debugging
xrepo update-repo
xrepo env -b emmylua_debugger – xmake build #调试构建
xrepo env -b emmylua_debugger – xmake install -o /tmp #调试安装
Create Project:
xmake create -l c -P ./hello
xmake create -l c -t console test
xmake create -l c -t static test
xmake create -l c -t shared test
xmake create -l c++ -t console_qt test
xmake create -l c++ -t static_qt test
xmake create -l c++ -t shared_qt test
xmake create -l c++ -t quickapp_qt test
xmake create -t quickapp_qt -l c ++ appAndroidDemo
xmake create -t xcode.macapp -l objc test
xmake create -t xcode.iosapp -l objc test
xmake create -t xcode.framework -l objc test
xmake create -t xcode.bundle -l objc test
xmake create -l go -t console test
Build Project:
xmake #generate xmake.lua automatically and build
xmake f -y #generate xmake.lua automatically
Run Program:
xmake run hello || xmake r hello
Debug Program:
xmake config -m debug && xmake && xmake f –debugger=gdb && xmake run -d hello
Paltform:
xmake f -p wasm –toolchain=wasi [–qt=/Qt]/Qt/Qt5.9.1
xmake f -p [iphoneos|macosx|windows|android] -a [armv7|armv7s|arm64|i386|x86_64]
xmake f -p mingw –sdk=/usr/local/i386-mingw32-4.3.0/ [-a i386|x86_64|arm|arm64]
xmake f -p myplat –sdk=/usr/local/arm-xxx-gcc/
SDK:
xmake f –qt=
xmake f -p cross android –ndk=/Downloads/android-ndk-r19c/ –android_sdk=/Library/Android/sdk/ –bin=/usr/opt/bin –cross=armv7-linux- -c
xmake f –wdk=”G:\Program Files\Windows Kits\10” -c
xmake f –wdk_winver=[win10_rs3|win8|win7|win7_sp1]
xmake f –cuda=/usr/local/cuda-9.1/
Flags:
–cflags,–cxxflags, –ldflags, –shflags and –arflags
xmake f -p cross –sdk=/user/toolsdk
–cc=armv7-linux-clang
–cxx=armv7-linux-clang++
–ld=armv7-linux-clang++
–sh=armv7-linux-clang++
–ar=armv7-linux-ar
–includedirs=/usr/toolsdk/xxx/include
–linkdirs=/usr/toolsdk/xxx/lib
–links=pthread
–cflags=”-DTEST -I/xxx/xxx”
–ldflags=”-lpthread”
–cxflags Set c/c++ compiler option
g global configuration
-c clean all cached configuration and re-configure project.
(multiple directories use : under linux / macos, and ; under win.)
set_config(“cflags”, “-DTEST”)
set_config(“sdk”, “/home/xxx/tooksdk”)
set_config(“cc”, “gcc”)
set_config(“ld”, “g++”)
xmake f -m debug –menu –xxx=y –export=/tmp/config.txt –import=/tmp/config.txt
Install:
xmake install
xmake [p|package] -o outputdir -f remote #generate package
xmake uninstall
Custom toolchain:
xmake f –toolchain=[myclang,emcc]
–bin Set the bin directory of toolchains
–cross Set the prefix of compilation tools
–as Set asm assembler
–asflags Set asm assembler option
toolchain(“myclang”)
set_kind(“standalone”)
set_toolset(“cc”, “clang”)
set_toolset(“cxx”, “clang”, “clang++”)
set_toolset(“ld”, “clang++”, “clang”)
set_toolset(“sh”, “clang++”, “clang”)
set_toolset(“ar”, “ar”)
set_toolset(“ex”, “ar”)
set_toolset(“strip”, “strip”)
set_toolset(“mm”, “clang”)
set_toolset(“mxx”, “clang”, “clang++”)
set_toolset(“as”, “clang”)
Policies:
xmake f –ccache=n || xmake f –policies=build.ccache:n,build.sanitizer.address #n->禁用缓存,没有表示开启
set_policy(“build.warning”, true)
set_warnings(“all”, “extra”)
set_policy(“build.optimization.lto”, true) #link-time optimisation (LTO)
set_policy(“check.auto_ignore_flags”, false) #自动忽略
set_policy(“check.auto_map_flags”, false) #自定映射到不同平台
set_policy(“build.across_targets_in_parallel”, false) #多目标并行编译
set_policy(“build.ccache”, false)
set_policy(“build.sanitizer.address”, true)
set_policy(“build.sanitizer.undefined”, true)
set_policy(“build.sanitizer.thread”, true)
set_policy(“build.sanitizer.memory”, true)
set_policy(“build.sanitizer.leak”, true)
add_requires(“zlib”, {configs = {asan = true}}) #Address Sanitizer (ASan)
xmake f –policies=run.autobuild
set_policy(“package.librarydeps.strict_compatibility”, true)
set_policy(“package.download.http_headers”, “TEST1: foo”, “TEST2: bar”)
add_urls(“https://github.com/madler/zlib/archive/$(version).tar.gz“, {
http_headers = {“TEST1: foo”, “TEST2: bar”}
})
preprocessor.linemarkers
preprocessor.gcc.directives_only
package.requires_lock
package.precompiled
package.fetch_only
package.install_only
package.strict_compatibility
package.install_always
Help:
xmake create –help
xmake f –help
xmake show -l toolchains
xmake -v -D
xmake show -l envs
xmake l os.programdir
xmake [action|plugin] [-h|–help]
xmake [-q|–quiet]
xmake [-w|–warning]
xmake l find_package cmake::ZLIB
构建脚本调试:
https://xmake.io/#/guide/faq?id=breakpoint-debugging
无法连接9966端口,改”host”: “127.0.0.1”。或vscode底部重启EmmyLua。
xrepo update-repo
xrepo env -b emmylua_debugger – xmake build #调试构建
xrepo env -b emmylua_debugger – xmake install -o /tmp #调试安装
文档生成:
xmake doxygen
Executable Program:
– set project name
set_project(“tbox”)
– set project version
set_version(“1.5.1”, {build = “%Y%m%d%H%M”, soname = true})\
– the current xmake version must be larger than 2.1.0
set_xmakever(“2.1.0”)
add_moduledirs(“$(projectdir)/modules”)
add_packagedirs(“packages”)
add_rules(“mode.debug”, “mode.release”)
add_requires(“qt5widgets”, {optional = true, asan = true, debug = true, small=true, verify = false, external = false})
add_requires(“go::github.com/sirupsen/logrus”, {alias = “logrus”})
add_requires(“go::golang.org/x/sys/internal/unsafeheader”, {alias = “unsafeheader”})
add_requires(“cmake::ZLIB”, {alias = “zlib”, system = true})
add_requires(“cmake::Boost”, {system = true, configs = {components = {“regex”, “system”}}))
add_requires(“cmake::OpenCV”, {system = true, configs = {envs = {CMAKE_PREFIX_PATH = “xxx”}}})
add_requires(“cmake::xxx”, {configs = {link_libraries = {“abc::lib1”, “abc::lib2”}}})
add_requires(“libpng ~1.16”, “zlib 1.1.2 || >=1.2.11 <1.3.0”)
add_configfiles(“../include/co/config.h.in”, {filename = “../include/co/config.h”})
add_repositories(“my-repo my-repo”)
option(“linux-headers”, {showmenu = true, description = “Set linux-headers path.”})
if is_plat(“windows”, “macosx”) then
add_requires(“go::golang.org/x/sys/windows”, {alias = “syshost”})
add_links(“pthread”, “m”, “dl”)
else
for _, name in ipairs({“pthread”, “m”, “dl”}) do
add_links(name)
end
add_requires(“go::golang.org/x/sys/unix”, {alias = “syshost”})
end
if is_plat(“myplat”) then
add_defines(“TEST”)
end
target(“test”)
set_plat(“cross”)
set_arch(“c-sky”)
set_targetdir(“$(projectdir)/lib”)
set_rundir(“$(projectdir)”)
set_basename(“co”)
add_rules(“xcode.application” || “xcode.framework” || “xcode.bundle”)
add_files(“src/*.m”, “src/**.storyboard”, “src/*.xcassets”)
add_files(“src/Info.plist”)
add_values(“xcode.bundle_identifier”, “org.tboox.test”)
add_values(“xcode.codesign_identity”, “Apple Development: xxx@gmail.com (T3NA4MRVPU)”)
add_values(“xcode.mobile_provision”, “iOS Team Provisioning Profile: org.tboox.test”)
after_load(function (target)
for _, sourcebatch in pairs(target:sourcebatches()) do
if sourcebatch.sourcekind == “as” then – only asm files
for idx, objectfile in ipairs(sourcebatch.objectfiles) do
sourcebatch.objectfiles[idx] = objectfile:gsub(“%.S%.o”, “.o”)
end
end
end
end)
target:set(“filename”, TARGET_NAME..”.elf”)
target:add(“ldflags”, flto .. “-Wl,–gc-sections -Wl,-zmax-page-size=1024 -Wl,–whole-archive ./lib/libwmarch.a ./lib/libgt.a ./lib/libwlan.a ./lib/libdsp.a ./lib/libbtcontroller.a -Wl,–no-whole-archive -mcpu=ck804ef -nostartfiles -mhard-float -lm -Wl,-T./ld/air101_103.ld -Wl,-ckmap=./build/out/“..TARGET_NAME..”.map “,{force = true})
target(“usbview”)
add_rules(“win.sdk.application”)
add_files(“*.c”, “*.rc”)
add_files(“xmlhelper.cpp”, {rule = “win.sdk.dotnet”})
set_values(“wdk.sign.certfile”, path.join(os.projectdir(), “xxxx.cer”))
set_values(“wdk.env.winver”, “win10”)
target(“qt_static_library”)
add_rules(“qt.static” || “qt.shared” || “qt.console” || “qt.quickapp” || “qt.quickapp_static” || “qt.qmlplugin” || “qt.widgetapp”)
add_packages(“qt5widgets”)
add_headerfiles(“src/*.h”)
add_files(“src/*.cpp”)
add_files(“src/mainwindow.ui”)
set_values(“qt.qmlplugin.import_name”, “My.Plugin”)
add_frameworks(“QtNetwork”, “QtGui”, “QtWidgets”)
target(“library”)
set_kind(“static” || “shared”)
add_files(“src/library/*.c”)
add_deps(“add”, “sub”)
set_policy(“build.merge_archive”, true) #合并静态库
target(“test”)
set_kind(“binary”)
set_languages(“c++11”)
add_packages(“protobuf-cpp”)
add_packages(“logrus”, “syshost”, “unsafeheader”)
add_rules(“lex”, “yacc”)
add_files(“src/*.c”)
add_files(“*.mpp”, { install = true })
add_deps(“library”)
– generate SASS code for SM architecture of current host
add_cugencodes(“native”)
– generate PTX code for the virtual architecture to guarantee compatibility
add_cugencodes(“compute_30”)
add_values(“iverilogs.flags”, “-DTEST”)
add_defines(“DEBUG”)
add_syslinks(“pthread”)
set_license(“GPL-2.0”)
set_policy(“build.c++.modules”, true)
set_toolchains(“@iverilog”, “clang”, “yasm”)
set_toolset(“cxx”, “clang”)
set_toolset(“ld”, “clang++”)
add_ldflags(“-static”, {force = true})
target_end()
target(“VBAO”)
set_installdir(“$(buildir)/install”)
add_installfiles(“Lib_VBao/COPYING.LESSER”,{prefixdir = “VBAO”})
add_installfiles(“Lib_VBao/VBAO/*“,{prefixdir = “VBAO/include”})
set_languages(“cxx17”)
set_kind(“headeronly”)
package(“foo”) # on/after/before_build/install/package/run
set_sourcedir(path.join(os.scriptdir(), “src”))
on_install(function(package)
import(“package.tools.xmake”).install(package, {})
end)
after_link(function (target)
import(“utils.archive.merge_staticlib”)
merge_staticlib(target, “libout.a”, {“libfoo.a”, “libbar.a”})
end)
on_fetch(function (package, opt)
return {includedirs = “/usr/src/linux-headers-5.0/include”}
end)
on_load(function (target)
if is_plat(“linux”, “macosx”) then
target:add(“links”, “pthread”, “m”, “dl”)
end
end)
after_build(function (target)
Import(“core.project.config”)
Local targetfile = target:targetfile()
Os.cp(targetfile, path.join(config.buildir(), path.filename(targetfile)))
Print(“build %s”, targetfile)
– Execute signature, if it fails, automatically interrupt, giving a highlight error message
os.run(“ldid -S$(projectdir)/entitlements.plist %s”, target:targetfile())
end)
on_load(“modules.test.load”)
on_install(“modules.test.install”)
on_run(function ()
– Internal scope
end)
after_package(function ()
– Internal scope
end)
if is_host(“windows”) then
set_urls(“http://cdndownload.openluat.com/xmake/toolchains/csky/csky-elfabiv2-tools-mingw-minilibc-$(version).tar.gz“)
add_versions(“20210423”, “e7d0130df26bcf7b625f7c0818251c04e6be4715ed9b3c8f6303081cea1f058b”)
add_versions(“20230301”, “1b958769601e8ba94a866df68215700614f55e0152933d5f5263899bb44d24f5”)
elseif is_host(“linux”) then
set_urls(“http://cdndownload.openluat.com/xmake/toolchains/csky/csky-elfabiv2-tools-x86\_64-minilibc-$(version).tar.gz“)
add_versions(“20210423”, “8b9a353c157e4d44001a21974254a21cc0f3c7ea2bf3c894f18a905509a7048f”)
add_versions(“20230301”, “dac3c285d7dc9fe91805d6275c11fa260511cdd6a774891cbe2d79ec73535e10”)
end
on_install(“@windows”, “@linux”, function (package)
os.vcp(“*“, package:installdir())
end)
– external scope
task(“hello”) do
– external scope
on_run(function ()
– Internal scope
end)
end
– option settings, only local settings are supported, not affected by global api settings
option(“test”)
– local scope of the current option
set_default(false)
set_showmenu(true)
set_description(“test1 option”)
option_end()
– local variables, only valid for current xmake.lua
local var1 = 0
– global variables that affect all subsmake.lua included after includes()
var2 = 1
includes(“src”)
target(“demo”, {kind = “binary”, files = “src/*.c”})
option(“test1”, {default = true, showmenu = true, description = “test1 option”})
Integrate CMake source library:
add_rules(“mode.debug”, “mode.release”)
package(“foo”)
add_deps(“cmake”)
set_sourcedir(path.join(os.scriptdir(), “foo”))
on_install(function (package)
local configs = {}
table.insert(configs, “-DCMAKE_BUILD_TYPE=” .. (package:debug() and “Debug” or “Release”))
table.insert(configs, “-DBUILD_SHARED_LIBS=” .. (package:config(“shared”) and “ON” or “OFF”))
import(“package.tools.cmake”).install(package, configs)
end)
on_test(function (package)
assert(package:has_cfuncs(“add”, {includes = “foo.h”}))
end)
package_end()
add_requires(“foo”)
target(“demo”)
set_kind(“binary”)
add_files(“src/main.c”)
add_packages(“foo”)
常用命令:
– 显示目标文件路径
print(target:targetfile())
– 显示目标的构建类型
print(target:get(“kind”))
– 显示目标的宏定义
print(target:get(“defines”))
– 获取当前工程目录
print(project.directory())
– add_deps(“UIEvent”)
– add_links(“tbox”)
– add_linkdirs(“lib”)
import(“module”, {alias=”test”, rootdir=”./“, inherit = true})
testModule()
target(“Global”)
set_kind(“shared”)
add_files(“*.cpp”)
add_files(“Private/*.cpp”)
add_files(“Private/*/*.cpp”, “Private/**/*.cpp”)
– 添加src下的所有cpp文件,但是不包括src/test.cpp、src/hello.cpp以及src下所有带xx_前缀的cpp文件
– add_files(“src/*.cpp|test.cpp|hello.cpp|xx_*.cpp”)
add_includedirs(“Private”, {private = true})
add_includedirs(“Private/Port”, {private = true})
add_includedirs(“Public”, {interface = true}) – public 当前target,依赖的子target都会被设置
add_defines(“BUILDING_$(target:name():upper)”)
– os模块
– 运行shell命令,如果运行失败直接中断,并显示出错信息,我们不需要判断返回值
os.run(“echo hello xmake!”)
– 复制文件
os.cp(“/tmp/src”, “/tmp/dst”)
– 删除文件或者目录
os.rm(“/tmp/dir”)
– 移动文件
os.mv(“/tmp/old”, “/tmp/new”)
– 判断文件是否存在
if os.isfile(“/tmp/file”) then
end
– 判断目录是否存在
if os.isdir(“/tmp/dir”) then
end
– 匹配遍历文件,*为非递归匹配,**为递归匹配
for _, file in ipairs(os.match(“src/*.c”)) do
print(file)
end
– 匹配遍历目录,*为非递归匹配,**为递归匹配
for _, file in ipairs(os.match(“src/*“, true)) do
print(file)
end
– 常用api
– 抛出异常,立即中断
raise()
– 抛出异常,立即中断,并抛出异常错误信息
raise(“error info”)
– 抛出异常,立即中断,并抛出异常错误代码
raise(-1)
– 显示输出并换行,支持格式化输出,跟lua的print稍有不同
print(“hello %s”, “xmake”)
– 显示输出不换行
printf(“hello %s”, “xmake”)
– 格式化字符串
s = format(“hello %s”, “xmake”)
– 异常捕获api
try
{
– try块,里面抛出异常
function ()
raise(“error”)
end,
catch
{
– catch块,捕获异常
function (errors)
print(errors)
end
}
}
– 获取try块的返回值,如果没有异常的话返回true
local ok = try
{
– try块,里面抛出异常
function ()
– may be error
return true
end
}
try
{
– try块,里面抛出异常
function ()
raise(“error”)
end,
catch
{
– catch块,捕获异常
function (errors)
print(errors)
end
},
finally
{
– finally 块
function ()
end
}
}
– path模块
– 获取相对路径
path.relative(“/tmp/a”)
– 获取绝对路径
path.absolute(“src”)
– 获取目录
path.directory(“/tmp/a”)
– 获取文件名 test.c
path.filename(“/tmp/test.c”)
– 获取base名 test
path.basename(“/tmp/test.c”)
– 获取扩展名
path.extension(“/tmp/test.c”)
– 拼接路径 /tmp/test.c
path.join(“/tmp”, “test.c”)
– io 模块
– 打开一个写文件
file = io.open(“/tmp/a”, “w”)
– 写文件数据
file:write(“hello”)
– 写文件格式化行
file:print(“hello %s”, “xmake”)
– 写文件格式化不换行
file:printf(“hello %s”, “xmake”)
– 关闭文件
file:close()
– 序列化写一个lua对象到文件
io.save(“/tmp/a”, object)
– 反序列化读取一个文件对象
object = io.load(“/tmp/a”)
– 读取文件数据,并显示
io.cat(“/tmp/a”)
– 模式替换文件内容, 替换空格字符为 “space”
io.gsub(“/tmp/a”, “%s”, “space”)
– tostring, tonumber
print(“$(tmpdir)”)
add_ldflags(“$(shell pkg-config –libs sqlite3)”)
– 如果手动启用了xmake f –demo=y 选项
if is_option(“demo”) then
– 编译demo目录下的代码
add_subdirs(“src/demo”)
end
– 外置变量
local root = “/tmp”
set_objectdir(root .. “.objs”)
set_dependir(“$(buildir)/.deps”)
local ld_data = io.readfile(“./ld/air101_103.ld”)
local ORIGIN, I_SRAM_LENGTH = ld_data:match(“I-SRAM : ORIGIN = 0x(%x+) , LENGTH = 0x(%x+)”)
skia编译:
add_requires(“skia”)
target(“demo”)


本文作者原创,首发在本博客;CSDN 上的同名文章已标注为转载并回链到本页:https://blog.csdn.net/qq_30220519/article/details/138974883
1 | #include <codecvt> |


本文作者原创,首发在本博客;CSDN 上的同名文章已标注为转载并回链到本页:https://blog.csdn.net/qq_30220519/article/details/138923721
https://github.com/AdobeXD/xd-awesome
https://developer.adobe.com/xd/uxp/develop/reference/ImageFill/
https://adobexdplatform.com/plugin-docs/reference/ui/layout/positioning.html
https://helpx.adobe.com/xd/user-guide.html
https://github.com/AdobeXD
https://developer.adobe.com/console/servicesandapis
https://medium.com/adobetech
https://community.adobe.com/t5/adobe-xd/ct-p/ct-xd?page=1&sort=latest\_replies&lang=all&tabid=all
https://www.youtube.com/channel/UCDtYqOjS9Eq9gacLcbMwhhQ
https://community.adobe.com/t5/indesign/ct-p/ct-indesign?page=1&sort=latest\_replies&filter=all&lang=all&tabid=discussions&label-sdk=
https://developer.adobe.com/xd/uxp/
https://helpx.adobe.com/cn/xd/help/create-component-states.html
https://adobe-type-tools.github.io/font-tech-notes/pdfs/5005.BDF\_Spec.pdf
https://helpx.adobe.com/cn/xd/help/work-with-lottie-animations.html
https://xd2sketch.com/
https://ui.marklion.cn/article/tools/adobe-xd-file-version-demote-open.shtml
https://www.adobe.com/cn/products/xd/features/whats-new.html


本文作者原创,首发在本博客;CSDN 上的同名文章已标注为转载并回链到本页:https://blog.csdn.net/qq_30220519/article/details/138921134
https://blog.csdn.net/MOU_IT/article/details/95229790
https://www.scons.org/doc/production/HTML/scons-user.html#idp105549032622280
common_sources = [‘test.c’]
src_files = Split(“””test.c
test.c”””)
Program(‘test’, [‘test.c’, ‘test.c’])
Program(‘test’, Glob(‘*.c’, exclude=[“os_*_specific_*.cpp”]) + + Glob(“os_%s_specific_*.cpp” % currentOS))
Program(‘test’, common_sources + ‘test.c’)
Program(‘test’, src_files)
Library(‘test’, [‘test.c’])
Program(‘test.c’, LIBS=[‘test’], LIBPATH=’.’)
Program(‘test.c’, LIBS=’test’, LIBPATH=[‘.’, ‘/usr/lib’])
Program(‘test.c’, CPPPATH=[‘include’,’/usr/include’])
Object(‘test.c’. CCFLAGS=’-DHELLO’) //生成.o
Program([‘test.o’, ‘test.o’])
objlst = Object(‘test.c’. CCFLAGS=’-DHELLO’)
Program(‘test.c’, LINKFLAGS = str(objlst[0]))
programlst = Program(objlst)
print(“The program file is: %s”%programlst[0])
Default(programlst)
test_c = File(‘test.c’)
dirs = Dir(‘test’)
fileOrDir = Entry(‘xyz’)
path = “#/include” #顶层相对路径
import os.path
program_list = Program(‘test.c’)
program_name = str(program_list[0])
if not os.path.exists(program_name)
print(“%s not exist!”%program_name)
env = Environment(VAR=”value”)
n=File(‘test.c’)
print(env.GetBuildPath([n, ‘sub/dir/$VAR’])) #构建位置
env.Install(“install”, “test.txt”) #scons install
env.Alias(‘install’, ‘/usr/bin’)
env.Install(‘/usr/bin’, hello)
env.InstallAs(‘/usr/bin/hello-new’, hello)
env.InstallAs([‘/usr/bin/hello-new’,
‘/usr/bin/goodbye-new’],
[hello, goodbye])
foo = env.SharedLibrary(target=”foo”, source=”foo.c”, SHLIBVERSION=”1.2.3”)
env.InstallVersionedLib(target=”lib”, source=foo)
Decider(‘timestamp-newer’) #通过时间戳判断文件是否改变,还有make,timestamp-match,content-timestamp
def decide_if_changed(dependency, target, prev_ni, repo_node=None):
if dependency.get_timestamp() != prev_ni.timestamp:
dep = str(dependency)
tgt = str(target)
if specific_part_of_file_has_changed(dep, tgt):
return True
return False
Decider(decide_if_changed)
env1 = Environment(CPPPATH = [‘.’])
env2 = env1.Clone()
env2.Decider(‘timestamp-match’)
env1.Program(‘prog-content’, ‘program1.c’)
env2.Program(‘prog-timestamp’, ‘program2.c’)
Depends(test, programlst)
hello_obj = Object(‘hello.c’, CCFLAGS=’-MD -MF hello.d’, CPPPATH=’.’)
SideEffect(‘hello.d’, hello_obj) #relevant targets executed sequentially, not in parallel
ParseDepends(‘hello.d’) #头文件依赖解析
Ignore(hello_obj, ‘hello.h’)
Ignore(‘.’, [hello_obj])
AlwaysBuild(hello)
import os
os.environ[“LIB_DIR”]=’usr/bin’ #全局库输出路径,跨script文件
print(“Shell is”, os.environ[‘SHELL’])
env = Environment(CC=’gcc’, CCFLAGS=’-O2’)
env.Program(‘test.c’)
print(“CC is: %s” % env[‘CC’])
print(“CC is: %s” % env.subst(‘$CC’))
print(“LATEX is: %s” % env.get(‘LATEX’, None))
env = Environment(FOO=’foo’, BAR=’bar’)
cvars = env.Dictionary()
for key in [‘OBJSUFFIX’, ‘LIBSUFFIX’, ‘PROGSUFFIX’]:
print(“key = %s, value = %s” % (key, cvars[key]))
for item in sorted(env.Dictionary().items()):
print(“construction variable = ‘%s’, value = ‘%s’” % item)
print(env.Dump())
env = Environment(CCFLAGS=’-DFOO’)
print(“CCCOM is: %s” % env[‘CCCOM’])
AllowSubstExceptions(IndexError, NameError, ZeroDivisionError)
def_env = DefaultEnvironment(tools=[‘gcc’, ‘gnulink’], CC=’/usr/local/bin/gcc’)
def_env[‘CC’] = ‘/usr/local/bin/gcc’
def_env.Replace(CCFLAGS=’-DDEFINE2’)
def_env.Append(CCFLAGS=[‘LAST’]) #存在继续追加AppendUnique
def_env.Prepend(CPPDEFINES=[‘FIRST’]) #PrependUnique
def_env.SetDefault(SPECIAL_FLAG=’-extra-option’) #只有值
env.SharedLibrary(
target=’word’,
source=’word.cpp’,
SHLIBVERSION=”1.2.3”,
SHLIBSUFFIX=’.ocx’,
LIBSUFFIXES=[‘.ocx’],
) #生成动态库
env.Program(‘hello’, ‘hello.c’, parse_flags=’-Iinclude -DEBUG -lm’)
path = [‘/usr/local/bin’, ‘/bin’, ‘/usr/bin’]
path = os.environ[‘PATH’]
env = Environment(ENV={‘PATH’: path})
env = Environment(ENV=os.environ.copy())
env.PrependENVPath(‘PATH’, ‘/usr/local/bin’)
env.AppendENVPath(‘LIB’, ‘/usr/local/lib’)
flags = {‘CCFLAGS’: ‘-whatever -O3’}
env.MergeFlags(flags)
env.MergeFlags(‘-whatever -I/usr/opt/include -O3 -I/usr/local/include’)
env = Environment(CCCOMSTR = “Compiling $TARGET”,
LINKCOMSTR = “Linking $TARGET”) #打印编译与构建命令
if ARGUMENTS.get(‘VERBOSE’) != ‘1’:
env[‘CCCOMSTR’] = “Compiling $TARGET”
env[‘LINKCOMSTR’] = “Linking $TARGET”
lib = env.Program(‘foo.c’)
env.Precious(lib) #构建过程中防止删除
env.NoClean(lib) #清除过程中防止删除
Progress(‘Evaluating $TARGET\n’)
import atexit
def print_build_failures():
from SCons.Script import GetBuildFailures
for bf in GetBuildFailures():
print(“%s failed: %s” % (bf.node, bf.errstr)) #Detailed Build Status
atexit.register(print_build_failures)
if not GetOption(‘help’):
SConscript(‘src/SConscript’, export=’env’) #sub scons
import os
num_cpu = int(os.environ.get(‘NUM_CPU’, 2))
SetOption(‘num_jobs’, num_cpu)
print(“running with -j %s” % GetOption(‘num_jobs’)) #并发执行
SetOption(‘random’, 1)
SetOption(‘experimental’, ‘ninja’)
AddOption(
‘–prefix’,
dest=’prefix’,
type=’string’,
nargs=1,
action=’store’,
metavar=’DIR’,
help=’installation prefix’,
)
env = Environment(PREFIX=GetOption(‘prefix’))
installed_foo = env.Install(‘$PREFIX/usr/bin’, ‘foo.in’)
Default(installed_foo)
vars = Variables(None, ARGUMENTS)
vars.Add(‘RELEASE’, help=’Set to 1 to build for release’, default=0)
env = Environment(variables=vars)
Help(vars.GenerateHelpText(env))
cppdefines = []
for key, value in ARGLIST:
if key == ‘define’:
cppdefines.append(value)
env = Environment(CPPDEFINES=cppdefines)
Command(
“file.out”,
“file.in”,
action=[
Delete(“tempdir”),
Mkdir(“tempdir”),
Copy(“tempdir/${SOURCE.file}”, “$SOURCE”),
“process tempdir”,
Touch(“$TARGET”), #更新文件
“process tempdir”,
Move(“$TARGET”, “tempdir/output_file”),
Delete(“tempdir”),
Chmod(“$TARGET”, 0o755),
],
)
t = Command(‘foo.out’, ‘foo.in’, ‘build -o $TARGET $SOURCE’)
Clean(t, ‘foo.log’)
VariantDir(‘build’, ‘src’, duplicate=False) #指定src目录编译输出要创建到build下面
SConscriptChdir(True) #进入子目录,改变目录
SConscript(‘src/SConscript’, variant_dir=’build’, duplicate=False)
SConscript(
[
‘drivers/display/SConscript’,
],
exports=’env’
)
Export(args)
Import(‘env’) #变量跨script导出导入,‘*’代表导入所有
Return(‘obj’) #调用script返回
import dbm.gnu
SConsignFile(dbm_module=dbm.gnu)
objs = []
for subdir in [‘foo’, ‘bar’]:
o = SConscript(‘%s/SConscript’ % subdir)
objs.append(o)
env.Library(‘prog’, objs)
Repository(‘/usr/repository1’, ‘/usr/repository2’) #添加编译查找目录或script文件,优先级较高
conf = Configure(env)
if not conf.CheckCHeader(‘math.h’):
print(‘Math.h must be installed!’)
Exit(1)
if conf.CheckCHeader(‘foo.h’): #CheckFunc(‘strcpy’) CheckLib(‘m’) CheckLibWithHeader(‘m’, ‘math.h’, language=’c’) CheckType(‘off_t’, ‘#include <sys/types.h>\n)必须包含头文件
CheckTypeSize(‘unsigned int’) CheckProg(‘foobar’):
conf.env.Append(CPPDEFINES=’HAS_FOO_H’)
env = conf.Finish()
conf = Configure(env, , custom_tests={‘CheckMyLibrary’: CheckMyLibrary}) #自定义CheckMyLibrary
def CheckMyLibrary(context):
context.Message(‘Checking for MyLibrary…’)
result = context.TryLink(mylib_test_source_file, ‘.c’)
context.Result(result)
return result
if not conf.CheckMyLibrary():
CacheDir(‘/usr/local/build_cache’)
NoCache(‘hello.o’)
LAUNCHDIR = GetLaunchDir() #执行scons目录
env = Environment(COMPILATIONDB_USE_ABSPATH=True) #compile_commands.json
env.Tool(‘compilation_db’) #ninja
cdb = env.CompilationDatabase(‘compile_database.json’)
Alias(‘cdb’, cdb)
scons -c VERBOSE=1 -Q -j32 COLOR=magenta –tree=prune,all,linedraw,status,derived –debug=explain,presub,findlibs,stacktrace,prepare,duplicate –warn=target-not-built –implicit-cache –cache-show –cache-disable –cache-force –random –implicit-deps-changed –implicit-deps-unchanged -n –experimental=ninja –compilers=mingw –taskmastertrace=- prog –prefix=/tmp/install test -Y /usr/repository1
Help(“””
Type: ‘scons program’ to build the production program,
‘scons debug’ to build the debug version.
“””, append=True)
if env[‘PLATFORM’] == ‘win32’:
Help(“\nType: ‘scons windebug’ to build the Windows debug version.\n”)
if ‘bar’ in COMMAND_LINE_TARGETS:
print(“Don’t forget to copy `bar’ to the archive!”)
if Execute(Mkdir(‘/tmp/my_temp_directory’)):
# A problem occurred while making the temp directory.
Exit(1)
platform = ARGUMENTS.get(‘OS’, Platform()) #scons -Q OS=linux
for platform in [‘newell’, ‘post’]:
SConscript(‘src/SConscript’, variant_dir=’build/‘ + platform)
EnsurePythonVersion(2, 5)
EnsureSConsVersion(1, 0)
print(env.Dump())
GetDepend(macro)
scons -h
scons –target=vs2012 -s —verbose
python -m pip install ninja


本文作者原创,首发在本博客;CSDN 上的同名文章已标注为转载并回链到本页:https://blog.csdn.net/qq_30220519/article/details/138914567
Visual Studio 2022 添加自定义代码片段_vs2022 代码片段-CSDN博客
dclass.snippet:
<![CDATA[/**
* @brief 状态事件执行器,customer作为事件执行的参数
* @usage 组件集UI反射更新事件通知eSE_UpdateSGStatusEvent,参数:需要通知反射的UI
*/
]]>
dcode.snippet:
<![CDATA[/// 注释 ///< 注释]]>
ddetail.snippet:
<![CDATA[
/**
* @brief 函数简介
* @detail 详细说明
*
* @param 形参 参数说明
* @param 形参 参数说明
* @return 返回说明
* @retval 返回值说明
* @note 注解
* @attention 注意
* @warning 警告
* @exception 异常
*/
]]>
dfile.snippet:
<![CDATA[
/**
* @file 文件名
* @brief 简介
* @details 细节
* @mainpage 工程概览
* @author 作者
* @email 邮箱
* @version 版本号
* @date 年-月-日
* @license 版权
*/
]]>
dfunc.snippet:
<![CDATA[
/*
* @brief 获取与给定ID对应的对象.
* @param [in] guiId FicGUID
* @param [out] guiId FicGUID
* @return 对应的返回说明
* @retval 返回值说明
*/
]]>
dother.snippet:
<![CDATA[
/**
* @see 参考
* @class 引用类
* @var 引用变量
* @enum 引用枚举
* @code 代码块开始
* @endcode 代码块结束
* @bug 缺陷
* @todo TODO
* @example 使用例子说明
* @remarks 备注说明
* @pre 函数前置条件
* @post 用来说明代码项之后的使用条件。
* @deprecated 函数过时说明
* @name 分组名
* @relates
* @since 从哪个版本后开始有这个函数的
* @defgroup 模块名
* @{ 模块开始
* @} 模块结束
* @version 版本号
* @fn 声明一个函数
* @par 开始一个段落,段落名称描述由你自己指定,比如可以写一段示例代码
* - 一级项目符号
* -# 二级项目符号
*/
]]>


本文作者原创,首发在本博客;CSDN 上的同名文章已标注为转载并回链到本页:https://blog.csdn.net/qq_30220519/article/details/138913941
Visual Studio扩展开发(VS插件)-CSDN博客
VS2017-快速添加注释(带时间戳)_vs2017注释-CSDN博客
https://www.cnblogs.com/kekec/p/10522250.html
https://docs.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2017/extensibility/vsct-xml-schema-reference?view=vs-2017
https://github.com/search?l=C%2B%2B&p=2&q=visual+stdio&type=Repositories
https://github.com/vilic/vs-force-utf8/blob/master/ForceUTF8Package.cs
https://github.com/microsoft/VS-PPT
https://github.com/microsoft/VS-PPT/tree/master/src
https://github.com/onlyutkarsh/VisualStudioStatusBarDemo
https://github.com/Microsoft/VSSDK-Extensibility-Samples
https://github.com/zooba/indentguide
https://github.com/madskristensen/WebEssentials2013
https://github.com/peterjc123/ColorfulIDE
https://github.com/tomasr/viasfora
https://github.com/MykolaBalakin/VSOutputEnhancer
https://github.com/tomasr/viasfora
https://github.com/mrlacey/WarnAboutTodos
https://github.com/laurentkempe/GitDiffMargin
https://github.com/awulkiew/graphical-debugging
https://github.com/zooba/indentguide
https://github.com/Microsoft/VS-Macros
https://github.com/madskristensen/ExtensibilityTools
https://github.com/n0lavar/DoxygenComments
https://my.oschina.net/u/3772973/blog/4601411
https://marketplace.visualstudio.com/items?itemName=NickKhrapov.DoxygenComments
http://t.zoukankan.com/lsgsanxiao-p-5915410.html
http://t.zoukankan.com/Leo\_wl-p-3199605.html
https://www.zhihu.com/question/19901690
https://www.one-tab.com/
https://github.com/dragospop/CppDoxyComplete
https://github.com/HelloWorld886/xmake-visualstudio


tag:
缺失模块。
1、请确保node版本大于6.2
2、在博客根目录(注意不是yilia根目录)执行以下命令:
npm i hexo-generator-json-content --save
3、在根目录_config.yml里添加配置:
jsonContent:
meta: false
pages: false
posts:
title: true
date: true
path: true
text: false
raw: false
content: false
slug: false
updated: false
comments: false
link: false
permalink: false
excerpt: false
categories: false
tags: true