Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

Commit

Permalink
refactor version numbers and toolchain flags
Browse files Browse the repository at this point in the history
  • Loading branch information
LunarLambda committed Feb 19, 2023
1 parent ba5c35a commit 51f07d2
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 18 deletions.
2 changes: 1 addition & 1 deletion dist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ make_dist() {

[ ! -d "$DIST" ] && mkdir "$DIST" || rm "$DIST"/*

(PROJECT=libseven VERSION=0.17.1 make_dist)
(PROJECT=libseven VERSION=0.17.2 make_dist)
(PROJECT=minrt VERSION=0.7.3 make_dist)
2 changes: 1 addition & 1 deletion libseven/include/seven/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#define LIBSEVEN_VERSION_MAJOR 0
#define LIBSEVEN_VERSION_MINOR 17
#define LIBSEVEN_VERSION_PATCH 1
#define LIBSEVEN_VERSION_PATCH 2

#define LIBSEVEN_VERSION \
_LIBSEVEN_STR2(LIBSEVEN_VERSION_MAJOR) "." \
Expand Down
4 changes: 1 addition & 3 deletions libseven/meson.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version = '0.17.1'

sources = [
'src/hw/bios.s',
'src/hw/dma.s',
Expand Down Expand Up @@ -33,6 +31,6 @@ install_subdir('include/seven', install_dir: get_option('includedir'))
libseven_dep = declare_dependency(
include_directories: includes,
link_with: libseven,
version: version)
version: libseven_version)

meson.override_dependency('libseven', libseven_dep)
24 changes: 15 additions & 9 deletions meson.build
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
project('sdk-seven', 'c',
version: '0.19.4',
version: '0.19.5',
license: 'Zlib',
meson_version: '>=0.59.0',
default_options: ['warning_level=2', 'c_std=c99'])

add_project_arguments(
libseven_version = '0.17.2'
minrt_version = '0.7.3'

cflags = [
'-mthumb',
'-ffunction-sections',
'-fdata-sections',
language: 'c')
]

add_project_link_arguments(
ldflags = [
'-mthumb',
'-Wl,--gc-sections',
'-Wl,-z,max-page-size=1',
language: 'c')
'-Wl,-z,max-page-size=1'
]

# Generate debug info compatible with no$gba v3.05
#
# This does not work if libc or other system code is built with newer debug info
if get_option('debug')
add_project_arguments('-gdwarf-4', language: 'c')
cflags += '-gdwarf-4'
endif

cc = meson.get_compiler('c')
Expand All @@ -30,7 +33,7 @@ cc = meson.get_compiler('c')
has_nano = cc.find_library('c_nano', required: false).found()

if get_option('use_nano').require(has_nano).allowed()
add_project_link_arguments('-specs=nano.specs', language: 'c')
ldflags += '-specs=nano.specs'
endif

# Remove warnings on newer toolchains
Expand All @@ -43,9 +46,12 @@ endif
ld_h = run_command(cc, '-Wl,--help', capture: true, check: false)

if ld_h.stdout().contains('--no-warn-rwx-segments')
add_project_link_arguments('-Wl,--no-warn-rwx-segments', language: 'c')
ldflags += '-Wl,--no-warn-rwx-segments'
endif

add_project_arguments(cflags, language: 'c')
add_project_link_arguments(ldflags, language: 'c')

subdir('libseven')
subdir('minrt')
subdir('tools')
Expand Down
6 changes: 2 additions & 4 deletions minrt/meson.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version = '0.7.3'

sources_c = [
'src/c/exit.c',
'src/c/fini.c',
Expand Down Expand Up @@ -57,13 +55,13 @@ minrt_dep = declare_dependency(
include_directories: includes,
link_with: minrt,
link_args: link_args + ['-Trom.mem', '-Tgba.x'],
version: version)
version: minrt_version)

minrt_mb_dep = declare_dependency(
include_directories: includes,
link_with: minrt_mb,
link_args: link_args + ['-Tmultiboot.mem', '-Tgba.x'],
version: version)
version: minrt_version)

meson.override_dependency('minrt', minrt_dep)
meson.override_dependency('minrt-multiboot', minrt_mb_dep)

0 comments on commit 51f07d2

Please sign in to comment.