38 Commits

Author SHA1 Message Date
Graham Pentheny
13f4334438 Disable warnings as errors in the test project and set the warning level to the default 2026-02-08 13:42:21 -05:00
Graham Pentheny
89d215d551 Modernize premake5 file.
Removed a lot of duplicated declarations.  Tests no longer links to SDL for no reason, removed a lot of surgical compiler parameters to silence warnings about some questionable code.
2026-02-08 13:32:32 -05:00
Graham Pentheny
333aec628c Disable some noisy warnings-as-errors when compiling with gcc on linux 2026-02-03 16:02:48 -05:00
Graham Pentheny
07e66cd3d6 Fixed premake SDL2 framework linking on macOS 2026-02-03 15:45:06 -05:00
Graham Pentheny
d66cc87513 Fixed fastlz include declaration 2026-02-03 15:24:38 -05:00
Graham Pentheny
b0d08d51ee Separate contrib code into its own static library
So we can control compiler parameters
2026-02-03 11:53:17 -05:00
Graham Pentheny
6b7e0894fe Use older FatalCompileWarnings since the newer one seems to be broken on Linux with gcc 2026-02-02 22:48:03 -05:00
Graham Pentheny
39da322131 Set fatalwarnings setting per-project 2026-02-02 22:39:51 -05:00
Graham Pentheny
fef4d0e8b5 Added ImPlot 2025-09-05 01:15:47 -04:00
Graham Pentheny
2701b7320b Revert "Modernize fatal compiler warnings flag in premake config"
This reverts commit 6576b81673.
2025-09-04 22:07:10 -04:00
Graham Pentheny
6576b81673 Modernize fatal compiler warnings flag in premake config 2025-09-02 17:38:18 -04:00
Graham Pentheny
6b906538dc WIP DearImGui conversion 2025-07-10 11:11:54 -04:00
Graham Pentheny
f7f3b1daed Explicitly set c++ version per-project. Set RecastDemo and Tests projects to C++20
We don't care as much about ultra-compatibility with RecastDemo or Tests.  C++20 seems fairly universal at this point considering Unreal 5 ships with it as the default requirement.

We want to keep the other stuff to C++98 still because eventaully we'll convert it to C99 and not having a ton of modern C++ features everywhere make it significantly easier.
2025-03-29 14:00:10 -04:00
Graham Pentheny
93bd042349 Disable calls to isfinite when compiling with -ffast-math (#747)
Fast math is not required, but it speeds up some calculations at the expense of accuracy. There are some functions like dtMathIsfinite that use floating point functions that become undefined behavior when compiled with fast-math, so we need to conditionally short-circuit these functions when compiled with that flag.

-Wnan-infinity-disabled is complaining about the isfinite call in dtMathIsfinite.

This also sets the linux runner explicitly to Ubuntu 24.04, since ubuntu-latest defaults to 22.04 for some reason. This also updates gcc and clang to the latest versions in apt and logs their version to the run output.  We need at least clang18 to disable the -Wnan-infinity-disabled warning for Catch.

Finally, this also removes some unused code that was throwing a warning (and thus an error) on newer compiler versions.
2024-12-29 12:36:08 -05:00
Roman Siromakha
599fd0f023 Fix out of bounds access in dtMergeCorridorStartMoved and add tests (#635)
size can become negative if req > maxPath. This may happen when visited buffer is larger than path buffer.

Add tests to cover different use cases of the function including Should add visited points not present in path up to the path capacity to cover the fix.

List tests files explicitly. When new file is added CMake does not add it to the already generated list if GLOB is used.
2024-01-28 13:26:50 -05:00
Graham Pentheny
af6d4758ff Changed asserts to be explicitly disabled with RC_DISABLE_ASSERTS rather than using NDEBUG (#653)
* Changed asserts to be explicitly disabled with RC_DISABLE_ASSERTS rather than using NDEBUG

This gives explicit control to users over when recast asserts are enabled or disabled.  This is useful when users wish to disable asserts in debug mode or enable them in release mode.  e.g. it's common to compile game code in debug alongside third party code in release.

* Added Integration.md with documentation on the integration process for Recast
2023-08-09 19:15:04 -04:00
Graham Pentheny
f4a65fd317 Enable UBSan and ASan when building tests with clang 2023-04-14 17:38:30 -04:00
Alexey Sokolov
a015950eaa Use external Catch2 if available in cmake build (#600) 2023-03-25 13:29:08 -04:00
Graham Pentheny
17a19d0e82 Simplified macOS Build Process (#579)
This makes the default xcode project generated by premake work out of the box, and is generally easier for mac users.  Especially those who don't have permissions to modify /Library/Frameworks/

- Look for SDL in RecastDemo/Bin by default rather than /Library/Frameworks/
- Updated README build instructions
- Ignore SDL2.framework in RecastDemo/Bin
2022-11-11 21:04:29 -05:00
Graham Pentheny
ea7bfbee70 Fix clang linux builds (#578)
Also remove hard-coded filter on gmake premake target since it's deprecated in favor of gmake2. It also doesn't matter; what matters is that we filter on gcc, since the warnings we've disabled don't exist in clang and will throw errors.
2022-11-11 20:11:14 -05:00
Siddharth J Singh
e6b675bb9a Fastlz fix for -Wno-class-memaccess' is valid for C++/ObjC++ but not for C (#479)
* Added a selective filter for *.c files compiled on linux using make

Co-authored-by: Graham Pentheny <graham.pentheny@gmail.com>
2022-11-09 11:54:56 -05:00
Graham Pentheny
9098a81682 Change to C++14 instead of C++20
Updated appveyor version matrix.  Removed vs2013
2022-11-07 23:34:36 -05:00
Graham Pentheny
7dfa9849ca Updated Catch2 testing library to v3.1.1
https://github.com/catchorg/Catch2

Updated tests with new API changes as well.
2022-11-07 23:34:36 -05:00
Graham Pentheny
d576e71b25 Disable class-memaccess error to fix builds on Ubuntu with newer versions of GCC
Based on SgtVincent's suggestion here: https://github.com/recastnavigation/recastnavigation/issues/497#issuecomment-1293318731

Fixes #497
2022-10-29 14:37:10 -04:00
Graham Pentheny
96dc90b6ff Fix deprecation warnings when using premake5
The premake script generates some deprecation warnings when generating with premake5:
- "configuration" has been deprecated in favor of "filter"
- "solution" was renamed to "workspace"
2022-10-25 23:17:58 -04:00
Jakob Botsch Nielsen
df27e4eb1a Fix build
-Wno-error does not ignore unknown warnings on old GCC versions causing
problems when using it for new warnings. On the other hand, -Wno-X will
ignore unknown warnings, so we can use this instead.

Fix #403
Fix #413
2020-05-11 18:26:17 +02:00
cypheron
c40188c796 Permit false positive compile errors (gcc8) 2019-05-11 13:19:37 +02:00
Jakob Botsch Nielsen
3087e805b0 Add a matching placement delete for placement new
Even though it is a no-op this is good style and avoids a warning with
MSVC.

Fix #359
2018-11-05 14:26:08 +01:00
Jakob Botsch Nielsen
fe4d4392a6 Use SDL2.dll path relative to script file
Previously this was relative to the output file. This works around a
premake5 bug and as a bonus makes it easier if we in the future decide
to support out-of-source builds.
2018-11-05 13:34:08 +01:00
Jarrett
56dbf4c482 Allow 64 bit windows builds (#301) 2018-10-16 00:02:51 +02:00
Jakob Botsch Nielsen
c2d7463a38 Add Clang to Travis and treat warnings as errors
The GCC version used by Travis is old and appears not to support all the
warnings we would like to get, so reenable Clang. Additionally make lots
of cleanups to Travis config and make the build a lot faster too.

Also change both Travis and AppVeyor builds to treat warnings as errors,
and include VS2017 in the matrix for AppVeyor. I have also removed
VS2010 because it is ancient at this point.

Updated Premake to alpha12 and fixed the premake build file
appropriately.
2018-06-16 17:04:54 +02:00
Jonathan Adamczewski
7b7c941181 Disable exception handling in MS std headers 2017-10-14 20:24:18 +02:00
Geoyeob Kim
46654531e4 Fix 'dtRandomPointInConvexPoly()' returning a garbage value if s == 1.0f. (#271) 2017-05-15 16:26:35 +02:00
Ben Hymers
a2e16b8e6c Set warnings as errors on Linux 2017-01-12 12:07:49 +00:00
Graham Pentheny
512ec1fdfd Unit testing framework.
* Tests live in a "Tests" folder alongside the other components.  Inside the "Tests" folder, tests are split into folders by the component they test.  For example, the example unit test of "rcVdot" (which is implmemented in Recast/Recast.h) lives in "Tests/Recast/Tests_Recast.h".
* Uses the Catch testing framework
* One example test of "rcVdot"
* Tests are run on Travis and Appveyor after every build.  Failing unit tests will fail the build in both case.
* Added instructions on running unit tests to the readme
2016-01-06 18:22:39 -05:00
Jakob Botsch Nielsen
7230dea2e3 Ensure SDL2.dll is copied for paths with spaces
The generated VS project would fail to copy the SDL2.dll file
if the solution or Bin path contained spaces.
2016-01-05 12:08:27 +01:00
Graham Pentheny
2eb3abfb60 Updated RecastDemo to SDL2
* Renamed a bunch of variables in main.cpp to be more descriptive.
* Removed unnecessary SDLMain.h and SDLMain.m OSX objective-c class as well as the plist, strings, xib and icns files, which are not needed.
* included cstdio in imguiRenderGL since SDL2 doesn't do it for us.
* Updated premake5 script to support SDL2 and to set the debug directory, as well as copy the SDL2.dll to the target directory on Windows.
* Updated readme with more descriptive, platform-specific demo project setup instructions
* Updated appveyor build script to build vs2015 as well.
* Updated Travis build script to build SDL2 from source, because they use Ubuntu 12.04 which doesn't have the libsdl2-dev package in its repositories.
2016-01-04 18:56:51 -05:00
Ben Hymers
e558e98592 Add AppVeyor and Travis CI build scripts
Build scripts download SDL, download (or build) premake5, generate projects, then build, in several configurations and platforms

Project now builds with premake5 instead of premake4 to allow VS2015 project generation
Tweaked SDL directory dependency to work better with CI
Update README
2015-12-16 01:33:18 +00:00