Skip to content

Commit

Permalink
platforms: Switched over to the new more formal locm3 Meson build system
Browse files Browse the repository at this point in the history
  • Loading branch information
dragonmux committed Nov 30, 2023
1 parent d1001c4 commit 31e84ad
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 303 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -334,11 +334,6 @@ jobs:
with:
submodules: true

# Prepare the submodule as they conflict with the Meson build by default
# This is mesons job, but I can't figure out how to make it work :(
- name: Prepare submodules
run: cp -r deps/packagefiles/libopencm3/* deps/libopencm3/

# Build the firmware for all platform variants (currently available)
- name: Build
run: |
Expand Down
195 changes: 0 additions & 195 deletions deps/packagefiles/libopencm3/configure

This file was deleted.

60 changes: 0 additions & 60 deletions deps/packagefiles/libopencm3/meson.build

This file was deleted.

49 changes: 7 additions & 42 deletions src/platforms/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -28,48 +28,13 @@
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

# include libopencm3 subproject, providing dependencies for some platforms
libopencm3 = subproject('libopencm3', required: false)
if not libopencm3.found()
# Because for now we are sharing the directory for the libopencm3 subproject for meson and
# the libopencm3 submodule, and the upstream submodule does not contain the meson build
# we need to let meson fetch it itself as that is when the meson build overlay is applied,
# otherwise, meson detects that the subproject exists, but does not know what to do with it
# This is a workaround until the upstream buildsystem is updated to include the meson build
#
# This checks that the directory exists, and if it does, it checks if it contains the meson
# build overlay, if it does not, it means that the user cloned the submodule
#
# This just code is not required per-se, it is just here to provide the user with a better
# error message so they know what to do, as it is not obvious what and why the problem is
libopencm3_dir = meson.global_source_root() / 'deps' / 'libopencm3'
libopencm3_no_overlay = fs.is_dir(libopencm3_dir) and not fs.is_file(libopencm3_dir / 'meson.build')
error(
'libopencm3 subproject configuration failed',
libopencm3_no_overlay ? '''
The subproject directory exists but does not contain the meson build overlay, this is likely
because you cloned it as a submodule, either manually, or by running the `make` buildsystem
Please remove the submodule and try again, you can do this by running the following commands on
the root of the repository:
- `git submodule deinit --force deps/libopencm3`
- `meson subprojects purge --confirm libopencm3`
Note that this will remove all files in `deps/libopencm3`, any changes you made will be lost.
''' : '''
An unknown problem ocurred, the subproject was not found but should have been fetched automatically
Try the following:
- Make sure you have a working internet connection and try again
- Create a fresh build directory and configure without any extra options
- Make a fresh clone of the repository, do not clone the submodules, meson will take care of it
If the problem persists, please report the issue to https://github.com/blackmagic-debug/blackmagic/issues
''',
)
endif
# Pull in the libopencm3 subproject for various platform dependencies
libopencm3 = subproject(
'libopencm3',
default_options: [
'c_std=c11',
],
)

subdir('common')
subdir('common/stm32')
Expand Down

0 comments on commit 31e84ad

Please sign in to comment.