Support Clang (not Clang-Cl) compiler on Windows
Closed this issue · 1 comments
Deleted user commented
These results were on MSYS2 (CLANG64):
$ cmake ..
-- Building for: Ninja
-- The C compiler identification is Clang 16.0.5
-- The CXX compiler identification is Clang 16.0.5
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/msys64/clang64/bin/cc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/msys64/clang64/bin/c++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: C:/msys64/home/Administrator/potto/build
$ ninja -j1
[1/12] Building CXX object CMakeFiles/potto.dir/src/PottoModuleEntryManager.cpp.obj
[2/12] Building CXX object CMakeFiles/potto.dir/src/PottoModulePoolManager.cpp.obj
[3/12] Building CXX object CMakeFiles/potto.dir/src/potto.cpp.obj
[4/12] Linking CXX shared library libpotto.dll
[5/12] Building CXX object tools/CMakeFiles/pt-gen.dir/potto-gen/potto-gen.cpp.obj
FAILED: tools/CMakeFiles/pt-gen.dir/potto-gen/potto-gen.cpp.obj
C:\msys64\clang64\bin\c++.exe -IC:/msys64/home/Administrator/potto/include -IC:/msys64/home/Administrator/potto/thirdparty -std=gnu++11 -g -MD -MT tools/CMakeFiles/pt-gen.dir/potto-gen/potto-gen.cpp.obj -MF tools\CMakeFiles\pt-gen.dir\potto-gen\potto-gen.cpp.obj.d -o tools/CMakeFiles/pt-gen.dir/potto-gen/potto-gen.cpp.obj -c C:/msys64/home/Administrator/potto/tools/potto-gen/potto-gen.cpp
C:/msys64/home/Administrator/potto/tools/potto-gen/potto-gen.cpp:114:19: error: no matching constructor for initialization of 'std::ofstream' (aka 'basic_ofstream<char>')
std::ofstream ofs(outputFilePath, std::ios_base::trunc);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/clang64/include/c++/v1/fstream:1365:14: note: candidate constructor not viable: no known conversion from 'ghc::filesystem::path' to 'const char *' for 1st argument
explicit basic_ofstream(const char* __s, ios_base::openmode __mode = ios_base::out);
^
C:/msys64/clang64/include/c++/v1/fstream:1368:14: note: candidate constructor not viable: no known conversion from 'ghc::filesystem::path' to 'const wchar_t *' for 1st argument
explicit basic_ofstream(const wchar_t* __s, ios_base::openmode __mode = ios_base::out);
^
C:/msys64/clang64/include/c++/v1/fstream:1371:14: note: candidate constructor not viable: no known conversion from 'ghc::filesystem::path' to 'const string' (aka 'const basic_string<char>') for 1st argument
explicit basic_ofstream(const string& __s, ios_base::openmode __mode = ios_base::out);
^
C:/msys64/clang64/include/c++/v1/fstream:1380:5: note: candidate constructor not viable: requires single argument '__rhs', but 2 arguments were provided
basic_ofstream(basic_ofstream&& __rhs);
^
C:/msys64/clang64/include/c++/v1/iosfwd:141:32: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 2 were provided
class _LIBCPP_TEMPLATE_VIS basic_ofstream;
^
C:/msys64/clang64/include/c++/v1/fstream:1363:5: note: candidate constructor not viable: requires 0 arguments, but 2 were provided
basic_ofstream();
^
C:/msys64/home/Administrator/potto/tools/potto-gen/potto-gen.cpp:205:19: error: no matching constructor for initialization of 'std::ofstream' (aka 'basic_ofstream<char>')
std::ofstream ofs(outputFilePath, std::ios_base::trunc);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/clang64/include/c++/v1/fstream:1365:14: note: candidate constructor not viable: no known conversion from 'ghc::filesystem::path' to 'const char *' for 1st argument
explicit basic_ofstream(const char* __s, ios_base::openmode __mode = ios_base::out);
^
C:/msys64/clang64/include/c++/v1/fstream:1368:14: note: candidate constructor not viable: no known conversion from 'ghc::filesystem::path' to 'const wchar_t *' for 1st argument
explicit basic_ofstream(const wchar_t* __s, ios_base::openmode __mode = ios_base::out);
^
C:/msys64/clang64/include/c++/v1/fstream:1371:14: note: candidate constructor not viable: no known conversion from 'ghc::filesystem::path' to 'const string' (aka 'const basic_string<char>') for 1st argument
explicit basic_ofstream(const string& __s, ios_base::openmode __mode = ios_base::out);
^
C:/msys64/clang64/include/c++/v1/fstream:1380:5: note: candidate constructor not viable: requires single argument '__rhs', but 2 arguments were provided
basic_ofstream(basic_ofstream&& __rhs);
^
C:/msys64/clang64/include/c++/v1/iosfwd:141:32: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 2 were provided
class _LIBCPP_TEMPLATE_VIS basic_ofstream;
^
C:/msys64/clang64/include/c++/v1/fstream:1363:5: note: candidate constructor not viable: requires 0 arguments, but 2 were provided
basic_ofstream();
^
2 errors generated.
ninja: build stopped: subcommand failed.
Note: this issue is about MinGW based Clang, not MSVC based Clang.
tishion commented
will look into it