refactor: update compiler flag handling in CMake and ignore build log files
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -18,3 +18,5 @@ test_props.xml
|
|||||||
test_props2.xml
|
test_props2.xml
|
||||||
test_boost.cpp
|
test_boost.cpp
|
||||||
.claude/settings.json
|
.claude/settings.json
|
||||||
|
build_output.log
|
||||||
|
configure_output.log
|
||||||
|
|||||||
@@ -19,14 +19,14 @@ endif()
|
|||||||
|
|
||||||
project(uLib)
|
project(uLib)
|
||||||
|
|
||||||
# Remove GCC-only flag injected by conda's CFLAGS/CXXFLAGS that clang doesn't support.
|
# Applica la flag SOLO se il compilatore è GCC
|
||||||
# Must run after project() since that's when CMake initialises CMAKE_<LANG>_FLAGS from env.
|
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")
|
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||||
foreach(_lang C CXX)
|
add_compile_options(-Wno-ignored-optimization-argument)
|
||||||
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()
|
endif()
|
||||||
|
|
||||||
# CUDA Toolkit seems to be missing locally. Toggle ON if nvcc is made available.
|
# CUDA Toolkit seems to be missing locally. Toggle ON if nvcc is made available.
|
||||||
|
|||||||
Reference in New Issue
Block a user