Re: Meson build system user learning D.

2019-05-27 Thread Mike Brockus via Digitalmars-d-learn

On Thursday, 23 May 2019 at 06:14:11 UTC, Russel Winder wrote:
On Thu, 2019-05-23 at 04:21 +, Mike Brockus via 
Digitalmars-d-learn wrote:

[…]

That is cool that Atila was kind enough to accept the 
meson.build file.  But how do I use the written meson.build 
that is apparently in the subdirectory directory "build"?  
Just asking because normally I see a meson.build in the root 
of the project.


Having the meson.build in the project root directory is the 
norm, and that was where I put it originally. However, Atila 
chose to leave only the Dub build in the root directory and 
place all other build-related files in the build directory. 
This is not a problem since Meson is entirely happy with that 
structure.


I have my clone of unit-threaded in
~/Repositories/Git/Fork/Unit_Threaded and
I build in ~/BuildArea/Unit_Threaded. My meson command in the 
build

directory is:

meson --prefix=$HOME/Built 
~/Repositories/Git/Fork/Unit_Threaded/built


and this works fine. I then build and install using Ninja. To 
date it all works for me. If you try this and something goes 
wrong put an issue on the unit-threaded GitHub project area and 
email me in case I don't get a notification from the issue 
system.


I tried that custom command voodoo then I tried to use 'dub' as a 
method for hunting down dependencies.  Basically got something 
like this.


'''
Found DUB: /usr/local/bin/dub (DUB version 1.15.0, built on 
May  4 2019)

Dependency unit-threaded found: NO

meson.build:71:0: ERROR: Dependency "unit-threaded" not found
'''


Where can I find a reference for compiler flags?

2019-06-04 Thread Mike Brockus via Digitalmars-d-learn

If you never herd about Meson before:
樂. https://mesonbuild.com/

I was surprised to find out about Visual D.  And now I’m getting 
concerned about whether my current D projects will work on 
windows beings that I am about to move my operations on a Windows 
computer.


Where can I find a reference for compiler flags?

Also any recommendations for making windows compatible programs?

I would like to use the standard libraries over none standard.


What external libraries are available

2019-06-04 Thread Mike Brockus via Digitalmars-d-learn

If you never herd about Meson before:
樂. https://mesonbuild.com/

Hay there I was just wondering, what is the D equivalent to C++ 
Boost and or Poco libraries?


Just wondering because I would like to start playing with other 
developers libraries and use them in a collection of examples for 
the library.  The examples will be lunched to a GitHub repository 
as a show case so the library developers can show a link to new 
potential users that seek examples.


What I mean by Boost or Poco equivalent is a grouping of fully 
functional packages/modules.  It’s ok if you recommend a single 
library and it is a plus if Meson build is apart of the library.


I am aware of Mir Libraries being a group of libraries and 
incorporates the use of Meson, however I normally like to see 
what my options are to better plan my applications.


Re: How can I structure a Meson build project in D to use DUB.

2019-05-28 Thread Mike Brockus via Digitalmars-d-learn

On Tuesday, 28 May 2019 at 18:13:17 UTC, GoaLitiuM wrote:

On Tuesday, 28 May 2019 at 18:11:09 UTC, Mike Brockus wrote:
How can I structure a Meson build project in D to use dub as a 
method for dependencies like urld, d2sqlite or unit-threaded?


If that is not what Meson users of D do then what is the pure 
Meson of things way?


C https://github.com/squidfarts/c-example
D https://github.com/squidfarts/d-example


You simply change the method to dub for dependencies, as shown 
here: 
https://github.com/mesonbuild/meson/blob/master/test%20cases/d/11%20dub/meson.build#L8


So how does it work?  Should the dependency be downloaded already 
or will the dub method get the package from a repository of some 
kind?


How can I structure a Meson build project in D to use DUB.

2019-05-28 Thread Mike Brockus via Digitalmars-d-learn
How can I structure a Meson build project in D to use dub as a 
method for dependencies like urld, d2sqlite or unit-threaded?


If that is not what Meson users of D do then what is the pure 
Meson of things way?


C https://github.com/squidfarts/c-example
D https://github.com/squidfarts/d-example



Re: Where can I find a reference for compiler flags?

2019-06-09 Thread Mike Brockus via Digitalmars-d-learn

On Wednesday, 5 June 2019 at 09:45:53 UTC, Jacob Carlborg wrote:

On 2019-06-05 03:19, Mike Brockus wrote:


Where can I find a reference for compiler flags?


Here's the reference [1]. You can also run "dmd --help" to 
print out the available flags. [1] might not be up to date.


[1] https://dlang.org/dmd-windows.html


This bit of information was helpful.  But do you know what this 
is -dip- followed by some number...  I seen three of them in Mir 
Algorithm meson build.


Re: What external libraries are available

2019-06-09 Thread Mike Brockus via Digitalmars-d-learn

On Wednesday, 5 June 2019 at 10:48:37 UTC, 9il wrote:

On Wednesday, 5 June 2019 at 01:20:46 UTC, Mike Brockus wrote:

If you never herd about Meson before:
樂. https://mesonbuild.com/

Hay there I was just wondering, what is the D equivalent to 
C++ Boost and or Poco libraries?


Just wondering because I would like to start playing with 
other developers libraries and use them in a collection of 
examples for the library.  The examples will be lunched to a 
GitHub repository as a show case so the library developers can 
show a link to new potential users that seek examples.


What I mean by Boost or Poco equivalent is a grouping of fully 
functional packages/modules.  It’s ok if you recommend a 
single library and it is a plus if Meson build is apart of the 
library.


I am aware of Mir Libraries being a group of libraries and 
incorporates the use of Meson, however I normally like to see 
what my options are to better plan my applications.


https://github.com/libmir/mir-algorithm
https://github.com/libmir/mir-core
https://github.com/libmir/mir-optim
https://github.com/libmir/mir-rundom
https://github.com/libmir/mir-runtime (exprimental)

All of them comes with Meson and are used in daily production.


Thanks for the suggestion to use LibMir, I will get started on 
the collections somewhere around winter or after I finish writing 
C, C++ examples based on the cpp-reference but embrace the 
importance of safe and secure software and other best practices.


Options for unit testing in D?

2019-06-20 Thread Mike Brockus via Digitalmars-d-learn

If you never herd about Meson before:
樂. https://mesonbuild.com/

I am wondering as to what options are available for a Meson build 
user when unit testing?


What I am trying todo is simply rewrite my C17 project reference 
templates to D versions so I may show other developers the basic 
structure of my project if I have a question about something or 
to influence the idea of Meson with D projects.  Excuse the Conan 
file.


As reference:
C17
https://github.com/squidfarts/c-example.git
https://github.com/squidfarts/c-project.git

Dlang
https://github.com/squidfarts/d-example.git




Re: Options for unit testing in D?

2019-06-21 Thread Mike Brockus via Digitalmars-d-learn

On Friday, 21 June 2019 at 17:52:43 UTC, Mike Wey wrote:

On 21-06-2019 06:08, Mike Brockus wrote:

[...]


If you are using the D unittests in your source you can 
recompile the same source with `d_unittest: true`, the 
appstream-generator project does this: 
https://github.com/ximion/appstream-generator/blob/master/src/asgen/meson.build#L108


Or you can keep the tests separate and compile these test 
separately like you are doing in your C project. I use this 
option in the GlibD project: 
https://github.com/gtkd-developers/GlibD/blob/master/tests/gobject/meson.build


So to use D 'unittest' I am required to include the main.d module 
file in the tester executable?


How can I override the defeat compiler select by Dub?

2019-06-23 Thread Mike Brockus via Digitalmars-d-learn
If you never seen Meson before then pick up a camera and take a 
picture:

樂  https://mesonbuild.com/

Hometown Meson user here simply just wondering how can I tell Dub 
to use dmd to compile my dependence in Meson?  It’s one of the 
last things blocking me from having healthy D Meson projects that 
integrate nicely with Dub based projects.


Re: Options for unit testing in D?

2019-06-22 Thread Mike Brockus via Digitalmars-d-learn

On Saturday, 22 June 2019 at 13:51:10 UTC, Paul Backus wrote:

On Friday, 21 June 2019 at 22:35:55 UTC, Mike Brockus wrote:

On Friday, 21 June 2019 at 17:52:43 UTC, Mike Wey wrote:

On 21-06-2019 06:08, Mike Brockus wrote:

[...]


If you are using the D unittests in your source you can 
recompile the same source with `d_unittest: true`, the 
appstream-generator project does this: 
https://github.com/ximion/appstream-generator/blob/master/src/asgen/meson.build#L108


Or you can keep the tests separate and compile these test 
separately like you are doing in your C project. I use this 
option in the GlibD project: 
https://github.com/gtkd-developers/GlibD/blob/master/tests/gobject/meson.build


So to use D 'unittest' I am required to include the main.d 
module file in the tester executable?


If you pass the `-main` flag to the compiler when building your 
tester executable, it will add an empty main function for you. 
For example:


dmd -unittest -main mymodule.d



I think we made a lot of progress, suddenly it's working and I 
don't need to include main. Is there a way to indicate based on 
console output that one executable is the tester and the other is 
the application?


test_exe = executable('test_exe',
sources: [ 'test.d' ],
d_args: [ '-main' ],
d_unittest: true,
include_directories: exe_dir)


Re: Meson build system user learning D.

2019-06-23 Thread Mike Brockus via Digitalmars-d-learn

On Monday, 27 May 2019 at 16:49:45 UTC, Russel Winder wrote:
On Mon, 2019-05-27 at 16:13 +, Mike Brockus via 
Digitalmars-d-learn wrote:

[…]

I tried that custom command voodoo then I tried to use 'dub' 
as a method for hunting down dependencies.  Basically got 
something like this.


Apologies but I am not sure what you have tried. Installing 
unit- threaded as a shared library is so as to build a D 
project without dub at all. What I didn't say in the previous 
email is that if you are installing libraries not to the 
standard place you have to set some environment variables. In 
my case, consistent with the build instructions I gave for my 
case:


PKG_CONFIG_PATH=.:/home/users/russel/Built/share/pkgconfig:/home/users/russel/Built/lib/pkgconfig
 LD_LIBRARY_PATH=.:/home/users/russel/Built/lib

Having . in the paths is not something everyone does though.


'''
 Found DUB: /usr/local/bin/dub (DUB version 1.15.0, built 
on

May  4 2019)
 Dependency unit-threaded found: NO

 meson.build:71:0: ERROR: Dependency "unit-threaded" not 
found

'''


This seems like you are using Dub from within the Meson/Ninja 
build, this is not something I do. I know you can use Dub from 
Meson to deal with dependencies, but this is not something I 
do. I build all the dependencies and then build the application 
without Dub.


If using Dub from Meson to handle dependencies becomes the de 
facto standard I'll give it a whirl.


I finally got D unit testing working without having to include 
main, it was only a compiler flag away and with the help of other 
D programmers.


https://github.com/squidfarts/d-porject

However that doesn’t mean I gave up on unit-threaded it’s just 
that I should start with using what is already provided by the 
language and if I happen to grow out of the basic tools then I 
will try again.  


Re: Meson build system user new to D.

2019-05-09 Thread Mike Brockus via Digitalmars-d-learn

On Wednesday, 8 May 2019 at 10:28:26 UTC, Andre Pany wrote:

On Monday, 6 May 2019 at 19:52:23 UTC, Mike Brockus wrote:
Hello everyone I am a Meson build system user and I am new to 
the D language, just wondering if there are compiler flags 
that I should add, unit testing frameworks, any good practices 
I can follow and or anything like that also some resources 
would be helpful thanks. (:


While I heard Meson is working for D, the prefered choice, in 
case you have D only applications/libraries is Dub.


If you also want build to build C/C++ together with D, Meson or 
other build systems are preferable.


What is your use case?

Kind regards
Andre


I did have a particular use case yet as I am just discovering the 
capabilities of D and I may
say that I appreciate that it looks like both Python and C mixed 
into one allegiant

programming language which makes it easy for me to learn.



Re: Meson build system user learning D.

2019-05-22 Thread Mike Brockus via Digitalmars-d-learn

On Tuesday, 21 May 2019 at 10:59:40 UTC, Russel Winder wrote:
On Tue, 2019-05-21 at 05:21 +, Mike Brockus via 
Digitalmars-d-learn wrote:



[…]
The solution from Reddit solves the problem for 'dub' but as 
part of my project C to D I wanted to use Meson and run test 
with whatever is available, coming next week I will try to 
incorporate 'unit-threaded' and if it works then I can tell 
Meson to include it as my decency and to use 'dub' to get it 
for me so I can focus on writing test for my code.  I am 
currently working on becoming an Android app developer leaning 
Kotlin and on the weekends it's D.


I use unit-threaded for my D code tests. Atila was kind enough 
to allow me to add a Meson build to unit-threaded. I therefore 
build and install a shared library of unit-threaded so as to 
avoid use of Dub in the Meson build of my D projects.



[…]

However it is good to know that there is currently no compiler 
for D on a AVR chip.


I thought GCC had an AVR backend so that GDC provides D on AVR.


That is cool that Atila was kind enough to accept the meson.build 
file.  But how do I use the written meson.build that is 
apparently in the subdirectory directory "build"?  Just asking 
because normally I see a meson.build in the root of the project.





Re: Meson build system user learning D.

2019-05-19 Thread Mike Brockus via Digitalmars-d-learn

On Sunday, 19 May 2019 at 07:46:11 UTC, Johannes Loher wrote:

Am 18.05.19 um 08:20 schrieb Mike Brockus:
Hello there this is your hometown Meson build system user here 
just

happen to have a
question related to unit testing in D.

So is there a way to run the unit-test in the test main as a 
costume

test runner in
"test/test.d", and run the executable program in "src/main.d", 
with this

resulting in two
executable binaries one for test and one for the program?

I was considering using Unity test framework so I would know 
that if I was running the test runner that it was definitely 
the custom test runner returning the value of all test cases 
ran and not a mistake of running the main executable program.  
But I am not sure if that would insulate the D programming 
community by not using the provided unit testing functionality 
in D.


I am mostly trying to make a version based on an existing C 
template but

with D language
syntax using whatever tools D provides along side Meson build 
system.  I

would give you
the link(s) but I haven't figured out how to add links here on 
the D

forum, and I just
registered.

Thanks...


Hey there,

I already tried to answer your questions on reddit.

You can post links here by simply pasting the URL (the link 
will not be highlighted in the editor, but it will be when it 
is posted).


Regarding your problem: Could you please describe what you are 
actually trying to do? Are you trying to use D in an exisiting 
Meson project (as an addition to the existing code)? Why are 
you trying to use the Unity test framework (I only had a quick 
look at it, but from what I saw it uses a lot of preprocessor 
macros which will make it difficult to get it wotk work 
properly with D). Why not use the built-in unittests or one of 
the many already existing unit testing frameworks for D ([1], 
[2], [3], [4], [5])?


[1] https://code.dlang.org/packages/unit-threaded
[2] https://code.dlang.org/packages/dunit
[3] https://code.dlang.org/packages/d-unit
[4] https://code.dlang.org/packages/fluent-asserts
[5] https://code.dlang.org/packages/trial


I am trying to do two things one being able to turn a pure C 
project into a pure D project without destroying the existing 
file structure.

The project (https://github.com/squidfarts/c-project.git)

The other is to make a new Arduino UNO board project that 
leverages existing C and C++ code so I can spend small amounts of 
time writing new D code as I update all of my Arduino 
applications.


I would like to use the Unity test framework for that Arduino UNO 
based project that uses D, C, C++ and both Meson build system and 
Conan package manager.  The part with C and C++ are just for 
linking with the Arduino libraries, including exiting classes 
while I write new D code to replace the existing C and C++ code 
where ever it makes since.  Conan is used to get both the Unity 
and CMock from GitHub.


For the pure D project I would like to use whatever D provides 
me.  Since you provided this list I would start with 
unit-threaded and see if it can help with this main function 
problem.


Meson build system user learning D.

2019-05-18 Thread Mike Brockus via Digitalmars-d-learn
Hello there this is your hometown Meson build system user here 
just happen to have a

question related to unit testing in D.

So is there a way to run the unit-test in the test main as a 
costume test runner in
"test/test.d", and run the executable program in "src/main.d", 
with this resulting in two

executable binaries one for test and one for the program?

I was considering using Unity test framework so I would know that 
if I was running the test runner that it was definitely the 
custom test runner returning the value of all test cases ran and 
not a mistake of running the main executable program.  But I am 
not sure if that would insulate the D programming community by 
not using the provided unit testing functionality in D.


I am mostly trying to make a version based on an existing C 
template but with D language
syntax using whatever tools D provides along side Meson build 
system.  I would give you
the link(s) but I haven't figured out how to add links here on 
the D forum, and I just

registered.

Thanks...


Meson build system user new to D.

2019-05-06 Thread Mike Brockus via Digitalmars-d-learn
Hello everyone I am a Meson build system user and I am new to the 
D language, just wondering if there are compiler flags that I 
should add, unit testing frameworks, any good practices I can 
follow and or anything like that also some resources would be 
helpful thanks. (:


How would I write a travis-ci file for a Meson Dlang project?

2019-07-16 Thread Mike Brockus via Digitalmars-d-learn
If you never seen Meson before then pick up a camera and take a 
picture:

樂  https://mesonbuild.com/

Hello, everyone.

I started adding continues integration as part of my development 
cycle and I was wondering how would I write a '.travis.yml' file 
for a D language project using Meson build system.


https://github.com/squidfarts/c-executable.git


How would I know if appvayer is parsing my yaml file?

2019-07-16 Thread Mike Brockus via Digitalmars-d-learn

If you never seen Meson before then set down and take a look:
樂  https://mesonbuild.com/

Quick question.
I started integrating ci/cd best practices to my Meson projects 
and I was wondering how would I know if AppVayer is parsing my 
yaml file? I know I got a failed build because it was set to 
MSBuild by default. But after I set the value to script, how 
would I know it's doing its work and not just spinning it wheels.


Reference.


Re: How would I know if appvayer is parsing my yaml file?

2019-07-16 Thread Mike Brockus via Digitalmars-d-learn

On Tuesday, 16 July 2019 at 22:24:32 UTC, Mike Brockus wrote:

If you never seen Meson before then set down and take a look:
樂  https://mesonbuild.com/

Quick question.
I started integrating ci/cd best practices to my Meson projects 
and I was wondering how would I know if AppVayer is parsing my 
yaml file? I know I got a failed build because it was set to 
MSBuild by default. But after I set the value to script, how 
would I know it's doing its work and not just spinning it 
wheels.


Reference.


Sorry forgot I had to put the full path.
https://github.com/squidfarts/c-example.git


How would I know if AppVayer is parsing my yaml file?

2019-07-17 Thread Mike Brockus via Digitalmars-d-learn
If you never seen Meson before then pick up a camera and take a 
picture:

樂  https://mesonbuild.com/

Quick question.
I started integrating ci/cd best practices to my Meson projects 
and I was wondering how would I know if AppVayer is parsing my 
yaml file? I know I got a failed build because it was set to 
MSBuild by default. But after I set the value to script, how 
would I know it's doing its work and not just spinning its wheels.


https://github.com/squidfarts/d-example.git


Re: How would I know if AppVayer is parsing my yaml file?

2019-07-17 Thread Mike Brockus via Digitalmars-d-learn

On Wednesday, 17 July 2019 at 18:42:20 UTC, Paul Backus wrote:

On Wednesday, 17 July 2019 at 17:03:16 UTC, Mike Brockus wrote:
If you never seen Meson before then pick up a camera and take 
a picture:

樂  https://mesonbuild.com/

Quick question.
I started integrating ci/cd best practices to my Meson 
projects and I was wondering how would I know if AppVayer is 
parsing my yaml file? I know I got a failed build because it 
was set to MSBuild by default. But after I set the value to 
script, how would I know it's doing its work and not just 
spinning its wheels.


https://github.com/squidfarts/d-example.git


This is a question about AppVeyor, not D, so you should post it 
to the AppVeyor support forum at https://help.appveyor.com/


Ok we'll do.