fixed warnings

This commit is contained in:
AndreaRigoni
2026-04-03 13:22:52 +00:00
parent 148c046a02
commit 7d72f825ae
2 changed files with 22 additions and 1 deletions

View File

@@ -15,11 +15,20 @@ if(POLICY CMP0167)
cmake_policy(SET CMP0167 NEW)
endif()
## -------------------------------------------------------------------------- ##
project(uLib)
# Remove GCC-only flag injected by conda's CFLAGS/CXXFLAGS that clang doesn't support.
# Must run after project() since that's when CMake initialises CMAKE_<LANG>_FLAGS from env.
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
foreach(_lang C CXX)
foreach(_var CMAKE_${_lang}_FLAGS CMAKE_${_lang}_FLAGS_RELEASE CMAKE_${_lang}_FLAGS_RELWITHDEBINFO CMAKE_${_lang}_FLAGS_DEBUG)
string(REPLACE "-fno-merge-constants" "" ${_var} "${${_var}}")
endforeach()
endforeach()
endif()
# CUDA Toolkit seems to be missing locally. Toggle ON if nvcc is made available.
option(USE_CUDA "Enable CUDA support" OFF)
if(USE_CUDA)

View File

@@ -65,6 +65,18 @@ cmake --preset conan-release
cmake --build build -j$(nproc)
```
5. **Clean build (wipe and rebuild everything):**
```bash
cmake --build build --clean-first -j$(nproc)
```
6. **Run tests:**
```bash
cmake --build build --target test -j$(nproc)
# or equivalently:
ctest --test-dir build --output-on-failure -j$(nproc)
```
#### LLVM/Clang build (clang + lld + ccache — fastest)
A `fast` conan profile is provided that uses **clang**, **lld** (LLVM linker), and **ccache**. Install them into your environment first: