You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
is wrong if there are any spaces in the flags in ${CXX_FLAGS_TO_CHECK}, which is valid and possible if you set CXXFLAGS and override these hardcoded options.
The approach of removing invalid flags instead of failing is not desirable. A user should know when compilation options are invalid and should correct these from the environment or by passing explicit CMake options. (c.f. ENH: Add Linux ppc64le builds conda-forge/qcdloop-feedstock#1)
(CMAKE_CXX_FLAGS_TO_CHECK hasn't been set yet, should be CXX_FLAGS_TO_CHECK).
Trying to guard users from incorrect compilation options ends up causing more harm than good, and it would be better to default to checking for the existence of environment variables like CXXFLAGS (as CMake already does) and in the absence of them set defaults based off of the compiler type.
In PR #23 CMake logic checks were added to try to catch invalid
CXXFLAGSon different platforms. I would argue these should be reverted as:qcdloop/CMakeLists.txt
Lines 34 to 39 in b778fa9
is wrong if there are any spaces in the flags in
${CXX_FLAGS_TO_CHECK}, which is valid and possible if you setCXXFLAGSand override these hardcoded options.The approach of removing invalid flags instead of failing is not desirable. A user should know when compilation options are invalid and should correct these from the environment or by passing explicit CMake options. (c.f. ENH: Add Linux ppc64le builds conda-forge/qcdloop-feedstock#1)
It contains logic errors like
qcdloop/CMakeLists.txt
Line 26 in b778fa9
(
CMAKE_CXX_FLAGS_TO_CHECKhasn't been set yet, should beCXX_FLAGS_TO_CHECK).Trying to guard users from incorrect compilation options ends up causing more harm than good, and it would be better to default to checking for the existence of environment variables like
CXXFLAGS(as CMake already does) and in the absence of them set defaults based off of the compiler type.