refactor: update compiler flag handling in CMake and ignore build log files

This commit is contained in:
AndreaRigoni
2026-04-03 14:32:21 +00:00
parent 7d72f825ae
commit 74ba67f072
2 changed files with 9 additions and 7 deletions

2
.gitignore vendored
View File

@@ -18,3 +18,5 @@ test_props.xml
test_props2.xml
test_boost.cpp
.claude/settings.json
build_output.log
configure_output.log

View File

@@ -19,14 +19,14 @@ 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.
# Applica la flag SOLO se il compilatore è GCC
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
add_compile_options(-fno-merge-constants)
endif()
# Disabilita il warning se il compilatore è Clang (o AppleClang)
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()
add_compile_options(-Wno-ignored-optimization-argument)
endif()
# CUDA Toolkit seems to be missing locally. Toggle ON if nvcc is made available.