dynalo icon indicating copy to clipboard operation
dynalo copied to clipboard

fix warnings and update cmake

Open sergio-eld opened this issue 4 years ago • 0 comments

  1. added a workaround on function pointer casting, since direct usage of reinterpret_cast results in a warning. That prevents the usage of a package in the project that treats warnings as errors.
  2. added CLEAN_BUILD option defaulted to OFF. If ON, the project will compile with all the warnings and treat them as errors. Works for MSVC and GNU.
  3. modified tests:
    • renamed test target from all_tests to loader, since it is ambiguous and ALL_TESTS is used by cmake
    • moved enable_testing to the root CMakeLists.txt as it is required by documentation.
    • added option BUILD_TESTS defaulted to ON
    • added test in cmake for EXCLUDE_FROM_ALL property on directory. If tests are enabled, parent project's test will fail because it won't build executables for testing. If the property is detected to be TRUE, no tests will be built.
    • added check for input arguments (checking argc) in loader test. Also added try-catch block and return -1 if test fails.
    • modified test to accept 1 argument as an absolute path to shared library. Since the test is now invoked with $<TARGET_FILE:shared> which provides an absolute path to the binary, the test works without errors for shared library name.

sergio-eld avatar May 26 '21 12:05 sergio-eld