Skip to content

Commit

Permalink
build: cleanup meson subdir conditional calls
Browse files Browse the repository at this point in the history
  • Loading branch information
c-dilks committed Jul 23, 2024
1 parent dbe2651 commit 3be1119
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 39 deletions.
1 change: 1 addition & 0 deletions bind/python/meson.build
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
pythondir = 'python'
project_pkg_vars += 'pythonpath=' + '${prefix}' / pythondir

install_subdir('pyiguana', install_dir: pythondir)
Expand Down
34 changes: 20 additions & 14 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -168,19 +168,35 @@ add_project_arguments(
language: [ 'cpp' ],
)

# start chameleon
use_chameleon = get_option('bind_fortran')
if use_chameleon
subdir('src/chameleon')
endif

# build and install shared libraries
subdir('src/chameleon')
subdir('src/iguana/services')
subdir('src/iguana/algorithms')
subdir('src/iguana/bindings')
subdir('src/iguana/tests')

# build bindings
pythondir = 'python'
# build and install bindings
if use_chameleon
subdir('src/iguana/bindings')
endif
if get_option('bind_python')
subdir('bind/python')
endif

# build examples
if get_option('install_examples')
subdir('examples')
endif

# generate documentation
if get_option('install_documentation')
subdir('doc/gen')
endif

# generate pkg-config file
project_pkg_vars_nonempty = []
foreach var : project_pkg_vars
Expand All @@ -196,16 +212,6 @@ pkg.generate(
variables: project_pkg_vars_nonempty,
)

# build examples
if get_option('install_examples')
subdir('examples')
endif

# generate documentation
if get_option('install_documentation')
subdir('doc/gen')
endif

# install environment setup files
if get_option('z_install_envfile')
configure_file(
Expand Down
2 changes: 0 additions & 2 deletions src/chameleon/meson.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use_chameleon = get_option('bind_fortran')

chameleon_sources = files(
'chameleon',
'src' / 'generator.rb',
Expand Down
42 changes: 19 additions & 23 deletions src/iguana/bindings/meson.build
Original file line number Diff line number Diff line change
@@ -1,26 +1,22 @@
if use_chameleon
algo_bind_c_sources += [ 'Bindings.cc' ]
algo_bind_c_headers = [ 'Bindings.h' ]

algo_bind_c_sources += [ 'Bindings.cc' ]
algo_bind_c_headers = [ 'Bindings.h' ]

# build C bindings
if get_option('bind_fortran')
algo_bind_c_lib = shared_library(
'IguanaBindingsC',
algo_bind_c_sources,
include_directories: [ project_inc ] + ROOT_dep_inc_dirs,
dependencies: project_deps,
link_with: [ services_lib, algo_lib ],
link_args: ROOT_dep_link_args + ROOT_dep_link_args_for_validators,
install: true,
build_rpath: ROOT_dep_rpath,
)
project_libs += algo_bind_c_lib
endif
install_headers(
algo_bind_c_headers,
subdir: meson.project_name() / 'bindings',
preserve_path: true,
# build C bindings
if get_option('bind_fortran')
algo_bind_c_lib = shared_library(
'IguanaBindingsC',
algo_bind_c_sources,
include_directories: [ project_inc ] + ROOT_dep_inc_dirs,
dependencies: project_deps,
link_with: [ services_lib, algo_lib ],
link_args: ROOT_dep_link_args + ROOT_dep_link_args_for_validators,
install: true,
build_rpath: ROOT_dep_rpath,
)

project_libs += algo_bind_c_lib
endif
install_headers(
algo_bind_c_headers,
subdir: meson.project_name() / 'bindings',
preserve_path: true,
)

0 comments on commit 3be1119

Please sign in to comment.