Commit Graph

15 Commits

Author SHA1 Message Date
dundargoc
036f86feac ci: provide separate macos releases for intel and arm
This will immensely reduce the complexity required to support both
architectures, reduce overall lines of code and unblock follow-up
simplifications.
2024-03-24 20:58:30 +01:00
dundargoc
2c1e8f7e96 build: use GIT_REPOSITORY for local URLs
`GIT_REPOSITORY` will cause cmake to rebuild if local dependency
changes, which isn't the case for `URL`.

Also document how to test a different commits of a dependency.
2024-03-23 13:36:12 +01:00
dundargoc
187ae67735 build: introduce variable DEPS_IGNORE_SHA for skipping dependency hash check
This will reduce friction as developers no longer need to provide a hash
when testing out different commits.

To skip the hash check, set `DEPS_IGNORE_SHA` to `TRUE` in
`cmake.deps/CMakeLists.txt`.
2024-03-19 08:52:03 +01:00
dundargoc
99b8a343e1 fixup: quick update, squash later 2023-11-20 15:21:55 +01:00
dundargoc
0007aa50bd
build: unset variables ending with "URL" if USE_EXISTING_SRC_DIR is ON
This will reduce required boilerplate, but more importantly it will
automatically unset variables ending on URL. This will help people
needing to avoid to unset the URL variable each time a new dependency is
added.

It is possible that this may remove a non-download variable ending on
"URL" in the future, however, the risk of this is likely much lower than
the risk of someone forgetting to unset the variable.
2023-03-04 00:30:07 +01:00
dundargoc
5ffd3d035d
build: build all dependencies in parallel (#22329)
Previously, all targets were connected in one main target called
third-party in order to remove any potentially conflicting shared
library. We can make each dependency target independent of each other by
only removing shared libraries from luajit and msgpack in their own
targets, as only these has unwanted shared libraries.
2023-02-19 21:11:27 +01:00
dundargoc
b8288df99b
build: introduce default build variables (#21991)
There are a number of cmake variables and cache variables that need to
be passed to all dependencies. This is not only cumbersome, but also
fragile as it's easy to miss adding or removing a flag from a dependency
by accident. Introducing a global variable that controls all builds
makes it much easier to handle our dependencies.

Also fixes the currently broken release workflow as we need to pass the
CMAKE_OSX_ARCHITECTURES variable to all dependencies built with cmake.
2023-01-25 14:36:17 +01:00
dundargoc
bc7daddaf0 build: rely on default cmake installation if possible
The default cmake installation process for dependencies that use cmake
on all platforms is in general more robust and less verbose, so we rely
on that if possible.
2022-10-21 11:48:12 +02:00
James McCoy
61da959bb4
build(deps): restore support for USE_EXISTING_SRC_DIR (#20491)
59d5f692f removed cmake.deps/cmake/DownloadAndExtractFile.cmake and
support for USE_EXISTING_SRC_DIR.  The Ubuntu nightly PPA still relies
on USE_EXISTING_SRC_DIR functionality since it can't access the network
during the build.

Supplying an empty value for ExternalProject_Add()'s URL value appears
to provide the needed mechanism to avoid re-downloading when the sources
are already present.  This is undocumented behavior, though, so it may
break in the future.

Now, if USE_EXISTING_SRC_DIR is set, the ExternalProject's URL variable
is unset, preventing the download and erroring out if the source doesn't
actually exist.
2022-10-06 15:14:38 +02:00
dundargoc
fbc66d798c build: define EP_PREFIX property
This is just to avoid the boilerplate of definining PREFIX for
each dependency.
2022-10-02 12:47:14 +02:00
dundargoc
59d5f692f8 build: rely on builtin cmake downloading rather than custom script
DownloadAndExtractFile.cmake was initially introduced as a workaround to
avoid the massive amounts of logs generated by the download progress.
This is not a problem anymore as ExternalProject_Add has had the
DOWNLOAD_NO_PROGRESS option since cmake version 3.1.
2022-10-02 12:39:48 +02:00
dundargoc
3ce325cfa2 build: remove code for cross-compilation
We don't support cross-compilation at the moment, so these can be safely
removed.
2022-10-02 12:39:20 +02:00
dundargoc
6e3a69b4cf
build: consistently set build type regardless of generator or platform #19760
Change the default build type to always be Debug, and allow only four
predefined build types: Debug, Release, RelWithDebInfo and MinRelSize.
Furthermore, flags meant for single-configuration generator (make,
ninja) will not be used for multi-configuration generators (visual
studio, Xcode), and flags meant for multi-configuration generators will
not be used for single-configuration generators.

This will allow Debug builds to be built with MSVC which requires that
all dependencies are also built with the Debug build type to avoid
runtime library mismatch.

The correct way to specify build type (for example Release) for
single-configuration generators (Make and Ninja) is to run

cmake -B build -D CMAKE_BUILD_TYPE=Release
cmake --build build

while for multi-configuration generators (Visual Studio, Xcode and Ninja
Multi-Config) is to run

cmake -B build
cmake --build build --config Release

Passing CMAKE_BUILD_TYPE for multi-config generators will now not only
not be used, but also generate a warning for the user.

Co-authored-by: dundargoc <gocundar@gmail.com>
2022-09-06 07:52:39 -07:00
dundargoc
11837e9b29 build: only use CMAKE_BUILD_TYPE for single-config generators
CMAKE_BUILD_TYPE is ignored for multi-config generators and creates a
warning that it's unused.
2022-08-13 21:22:07 +02:00
Justin M. Keyes
f05a2891d3 build: rename build-related dirs
Problem:
Dirs "config", "packaging", and "third-party" are all closely related
but this is not obvious from the layout. This adds friction for new
contributors.

Solution:
- rename config/ to cmake.config/
- rename test/config/ to test/cmakeconfig/ because it is used in Lua
  tests: require('test.cmakeconfig.paths').
- rename packaging/ to cmake.packaging/
- rename third-party/ to cmake.deps/ (parallel with .deps/)
2022-06-28 04:02:29 -07:00