Consider replacing/supplementing `common.hpp` with a meson configuration file

Open
#576 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
42/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Quiet
Tech stack
cpp
Domain
build-system

Research direction

Start by inspecting common.hpp and the existing Meson setup, then compare it with the proposed dwave/optimization/include/dwave-optimization/config.hpp.in configuration flow. Determine whether Meson configuration can replace or should supplement common.hpp, and verify that the resulting configuration works across the supported build paths.

Written by the indexing model from the issue text.

Description

enhancement

Something like

# Set up the configuration file
conf = configuration_data()
if cpp.has_type('ssize_t', prefix: '#include <sys/types.h>')
    conf.set('HAS_SSIZE_T', 1)
endif
configure_file(
    input: 'dwave/optimization/include/dwave-optimization/config.hpp.in',
    output: 'config.hpp',
    configuration: conf,
)

with a

// config.hpp.in
#mesondefine HAS_SSIZE_T

which we can then include.

I think it may be possible to replace common.hpp entirely with this, but needs more thought/experimentation.

Dominant language
C++
Stars
31
Forks
36
Avg merge
1d 9h
Merged PRs (30d)
4

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dwavesystems/dwave-optimization

All issues in dwavesystems/dwave-optimization

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.