Skip to content

cmake: Incorrect __float128 detection #191

@iv-m

Description

@iv-m

Current develop branch uses the following CMake code to detect presence of __float128 types:

check_cxx_source_compiles(config/has_float128.cpp QUADMATH_FOUND)

But check_cxx_source_compiles function takes code as the first argument, and, as far as I cant tell, cannot read the source from file. So, it tries to compile config/has_float128.cpp as C++ code, and, of course, fails. I'm getting the following error in CMakeFiles/CMakeConfigureLog.yaml:

Run Build Command(s): /usr/bin/cmake -E env VERBOSE=1 /usr/bin/gmake -f Makefile cmTC_38738/fast
/usr/bin/gmake  -f CMakeFiles/cmTC_38738.dir/build.make CMakeFiles/cmTC_38738.dir/build
gmake[1]: Entering directory '/usr/src/boost/bld/CMakeFiles/CMakeScratch/TryCompile-oiusM4'
Building CXX object CMakeFiles/cmTC_38738.dir/src.cxx.o
/usr/bin/c++ -DQUADMATH_FOUND   -o CMakeFiles/cmTC_38738.dir/src.cxx.o -c /usr/src/boost/bld/CMakeFiles/CMakeScratch/TryCompile-oiusM4/src.cxx
/usr/src/boost/bld/CMakeFiles/CMakeScratch/TryCompile-oiusM4/src.cxx:1:1: error: 'config' does not name a type
    1 | config/has_float128.cpp
      | ^~~~~~
gmake[1]: *** [CMakeFiles/cmTC_38738.dir/build.make:78: CMakeFiles/cmTC_38738.dir/src.cxx.o] Error 1
gmake[1]: Leaving directory '/usr/src/boost/bld/CMakeFiles/CMakeScratch/TryCompile-oiusM4'
gmake: *** [Makefile:127: cmTC_38738/fast] Error 2

Indeed /usr/src/boost/bld/CMakeFiles/CMakeScratch/TryCompile-oiusM4/src.cxx contains config/has_float128.cpp literally.

I'm using cmake 3.29.1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions