JuliaMath / openlibm

High quality system independent, portable, open source libm implementation
https://openlibm.org
Other
515 stars 141 forks source link

CMake updates #302

Closed ViliusSutkus89 closed 4 months ago

ViliusSutkus89 commented 4 months ago

Hello,

Thanks for the library. I'm trying to use it through CMake, but I've noticed a couple of lines that could be added there. I've changed to version number, to match the actual current number - 0.8.2. Added install command, to allow running cmake install, which installs the library and public headers from included directories. Directories are added to the search path using target_include_directories, so there's no need to add them using CFlags. 64 bit ARM architecture can be defined as aarch64, so I've added that to the if statement, which selects arch folder.

I've also added BUILD_SHARED_LIBS option. In this regard, this patch does the same as @theoparis suggested in #299, but according to CMake docs, the option string is also needed. The resulting add_library call is the same, so both PR's should be able to merge.

I've tried running the changes in CI, but somewhy windows clang64 errors about complaining about missing gcc. I haven't touched that part, so I assume the CI should error out without these changes too

Regards, Vilius

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 39.02%. Comparing base (4b83beb) to head (2899a5e). Report is 3 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #302 +/- ## ========================================== + Coverage 38.24% 39.02% +0.78% ========================================== Files 233 233 Lines 6139 6144 +5 Branches 1607 1608 +1 ========================================== + Hits 2348 2398 +50 + Misses 3394 3393 -1 + Partials 397 353 -44 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.