mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-24 18:38:26 +08:00
d09210c08b
This untangles the CMake versioning issues (I hope) as discussed in #4626. Note most of the advice found on the Internet about how to inject git versions into CMake is just wrong. The behavior we want is to unconditionally run the script build_tools/git_version_gen.sh at build time (i.e. when you invoke ninja or make, and not when you invoke cmake, which is build system generation time). This script is careful to only update the FISH-BUILD-VERSION-FILE if the contents have changed, to avoid spurious rebuilding dependencies of FISH-BUILD-VERSION-FILE. Assuming the git version hasn't changed, the script will run, but not update FISH-BUILD-VERSION-FILE, and therefore fish_version.o will not have to be rebuilt. This might normally rebuild more than is necessary even if the timestamp is not updated, because ninja computes the dependency chain ahead of time. But Ninja also supports the 'restat' option for just this case, and CMake is rad and exposes this via BYPRODUCTS. So mark FISH-BUILD-VERSION-FILE as a byproduct and make the script always update a dummy file (fish-build-version-witness.txt). Note this is the use case for which BYPRODUCTS is designed. We also have fish_version.cpp #include "FISH-BUILD-VERSION-FILE", and do a semi-silly thing and make FISH-BUILD-VERSION-FILE valid C++ (so there's just one version file). This means we have to filter out the quotes in other cases..
107 lines
1.7 KiB
Plaintext
107 lines
1.7 KiB
Plaintext
# Note that some of the patterns below should be in an individual's
|
|
# ~/.config/git/ignore file. For example, ".DS_Store" from people working on
|
|
# MacOS.
|
|
|
|
# File extensions that should never be checked in regardless of which project
|
|
# directory they reside in.
|
|
*.exe
|
|
*.app
|
|
*.out
|
|
*.so
|
|
*.dylib
|
|
*.dll
|
|
*.lai
|
|
*.la
|
|
*.a
|
|
*.lib
|
|
*.o
|
|
*.obj
|
|
*.lo
|
|
*.slo
|
|
*.d
|
|
*.gch
|
|
*.pch
|
|
*.xccheckout
|
|
*~
|
|
*~HEAD
|
|
*bak
|
|
*.new
|
|
*.orig
|
|
*.log
|
|
.Trash-*
|
|
*.DS_Store
|
|
.AppleDouble
|
|
.LSOverride
|
|
._*
|
|
Thumbs.db
|
|
ehthumbs.db
|
|
Desktop.ini
|
|
|
|
|
|
# These file names can appear anywhere in the hierarchy. They tend to be OS
|
|
# or build system artifacts.
|
|
autom4te.cache
|
|
aclocal.m4
|
|
Makefile
|
|
config.h
|
|
config.cache
|
|
config.h.in
|
|
config.status
|
|
messages.pot
|
|
.directory
|
|
.fuse_hidden*
|
|
|
|
|
|
# Directories that only contain transitory files from building and testing.
|
|
/doc/
|
|
/obj/
|
|
/share/man/
|
|
/share/doc/
|
|
/test/
|
|
/user_doc/
|
|
|
|
# File names that can appear in the project root that represent artifacts from
|
|
# building and testing.
|
|
/FISH-BUILD-VERSION-FILE
|
|
/command_list.txt
|
|
/command_list_toc.txt
|
|
/compile_commands.json
|
|
/confdefs.h
|
|
/configure
|
|
/doc.h
|
|
/fish
|
|
/fish.pc
|
|
/fish_indent
|
|
/fish_key_reader
|
|
/fish_tests
|
|
/lexicon.txt
|
|
/lexicon_filter
|
|
/toc.txt
|
|
/version
|
|
fish-build-version-witness.txt
|
|
|
|
# File names that can appear below the project root that represent artifacts
|
|
# from building and testing.
|
|
/doc_src/commands.hdr
|
|
/doc_src/index.hdr
|
|
/po/*.gmo
|
|
/share/__fish_build_paths.fish
|
|
/tests/*.tmp.*
|
|
/share/pkgconfig
|
|
/muparser-*/bk-deps
|
|
/muparser-*/shared-ld-sh
|
|
/muparser-*/build/autoconf/muparser.pc
|
|
/muparser-2.2.5/samples/example1/example1
|
|
/pcre2-*/configure.lineno
|
|
|
|
# xcode
|
|
## Build generated
|
|
/build/
|
|
/DerivedData/
|
|
xcuserdata/
|
|
*.moved-aside
|
|
*.xccheckout
|
|
*.xcscmblueprin
|
|
.vscode
|
|
|