Advertisement

CMake: Disable install()

Started by October 27, 2024 06:27 PM
26 comments, last by 1vanK 3 weeks, 3 days ago

This is simple example config for GitHub Actions that compiles debug and release versions of AngelScript on Linux using the clang and gcc compilers

https://github.com/1vanK/angelscript-mirror/blob/master/.github/workflows/main.yml

Do github actually provide the hardware environment to automatically deploy and run the test suite as well? I have my own Windows and Linux environments so I got those covered (though automating the test runs with every commits would be nice). But I would be very interested to have a MacOS env with Apple M1 or M2 to do the automated test runs.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Advertisement

Yes, you can add the step to the config to run the compiled application. For me the easiest way to do this is to add the desired applications to CMakeLists.txt

enable_testing()
add_test(…)
add_test(…)

and run in GitHub Actions config by

ctest --verbose --test-dir build_dir --timeout 60

GitHub environments: https://github.com/actions/runner-images

It looks very promising.

I'll have to find some time to actually sit down and read through everything to see if I can figure out how to set this up.

Given that I have very little time available, don't expect anything soon though. 🙂

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

The community on GitHub is active, if you create a repository, people will send you pull requests with ready-made configs)

Advertisement

Incorrect example in sdk\add_on\scriptstdstring\scriptstdstring_utils.cpp

// string str = "A|B||D";
// array<string>@ array = str.split("|");

Illegal variable name 'array'.

Is there a difference between

    string[]@ arr = str.split("|");

and

   string[] arr = str.split("|");

Is there some copying going on here?

1vanK said:
Incorrect example in sdk\add_on\scriptstdstring\scriptstdstring_utils.cpp

Thanks. I'll have it fixed.

1vanK said:
Is there a difference between

Yes. In the first case the variable will be a handle. The handle can be changed to a different object, or even set to null.

In the second case the variable is guaranteed to be a valid object (a null pointer exception would be raised if the function returns null). The variable will be initialized with a copy constructor taking the returned array as input.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

So that's it

array<array<int>> arr;
for (int i; …)
  for (int j; …)
    int a = arr[i][j]; // Copy arr[i] array on every step

and better to store

array<array<int>@> arr;

?

Or is there a reference here?

Advertisement