Because of issue https://github.com/xiph/flac/issues/437 compiler
flags are prepended instead of appended, so the user can override
them without altering the CMakeLists.txt.
Also, Clang doesn't support per-function optimize options, so in
CMake the fma file gets that option per-file. This is not supported
by automake.
cmake uses $(datadir}/cmake and $(libdir}/cmake as base path to
search for its moduels. Install FLAC cmake module in
$(libdir}/cmake/FLAC because it provides arch dependent API/ABI.
Signed-off-by: Tomasz Kłoczko <kloczek@github.com>
Based on some information somewhere on the internet, CMakeLists.txt
sets _FORTIFY_SOURCE=2 when its runtime functions are available and
_FORTIFY_SOURCE=1 when they are not. However, _FORTIFY_SOURCE=1
also requires runtime functions.
In some circles (Hydrogenaud.io for example) people share binaries
compiled from git, i.e. inbetween official releases. Files created
with these binaries cannot be discerned from others. To improve
troubleshooting, compiles from a git repository are marked with
the commit hash and date when configured with autotools or CMake
Without this patch, CMake places output binaries and libraries in
the respective source directories, like the autotools build system.
The Visual Studio build system places objects in the objs directory
Because CTest didn't run properly when building shared libs, this
commit changes the CMake behaviour on (NOT UNIX) to that similar
to Visual Studio. That way, DLLs and EXEs are placed in the same
directory and running CTest with the correct DLLs being loaded
is trivial.
Details:
- When building with CMake, pkg-config files flac.pc and flac++.pc
are not updated with Version information. This causes a failure
when running a configure script in opus-tools
(https://github.com/xiph/opus-tools).
Note that OGG_PACKAGE is set to "ogg" exactly as in the configure.ac,
but it is only set when the building explicitly with libogg.
This commit contains the following changes:
- Drops -fstack-protector in favor of -fstack-protector-strong.
Consequently, the ssp-buffer-size parameter has been removed as
-fstack-protector-strong ignores array size.
- Add new global opt-out for stack smash protection. This is enabled
by default for both autotools and CMake builds. Users can opt out
of stack smash protection by passing -DWITH_STACK_PROTECTOR=OFF to
CMake or --disable-stack-smash-protection when running ./configure.
- Renames HAVE_SSP_FLAG to HAVE_STACK_PROTECTOR_FLAG in
CMakeLists.txt to be more readable.
- document version requirements in the top-level file.
- remove incorrect version requirements from sub-dirs.
- set min. required version to 3.5 in top-level file.
- set minimun required version to 3.9 under docs/ .
- make documents building an option (on by default.)
so, the tree can be built using cmake-3.5 using
-DBUILD_DOCS=0 on the command line.
The 1.3.3 release didn't update the version number in the cmake
build. It's too late to fix the release, but bringing the version
number into sync allows the metaflac test which verifies the
encoder's embedded version number to pass, giving us proper test
feedback on other changes to the development tree.