Skip to content

Building progams without needing to specify libraries and source files? #9681

Answered by eli-schwartz
Shadowblitz16 asked this question in Q&A
Discussion options

You must be logged in to vote

meson is not going to parse your main.c and figure out what functions it makes use of. I don't know what the .net build system does...

What I do know is that meson provides functionality to get you most of the way there, by generating a project.

$ set -x; meson init *.c --name tinyproj --version 1.2
+ meson init bar.c foo.c --name tinyproj --version 1.2
Using "tinyproj" (project name) as name of executable to build.
Detected language: c
Generated meson.build file:

project('tinyproj', 'c',
  version : '1.2',
  default_options : ['warning_level=3'])

executable('tinyproj',
           'bar.c',
           'foo.c',
           install : true)
$ meson setup builddir/ <Flags>

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by eli-schwartz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #7963 on December 01, 2021 18:28.