[cfe-dev] Errors building clang with mingw

Óscar Fuentes ofv at wanadoo.es
Wed Mar 16 17:06:18 PDT 2011


Reid Kleckner <reid.kleckner at gmail.com>
writes:

>>> When I want to build with MinGW I do this from the normal cmd.exe
>>> command prompt:
>>>
>>>> cd C:\llvm
>>>> mkdir Build
>>>> cd Build
>>>> cmake -G "MinGW Makefiles" ..
>>>> make
>>>
>>> Binaries will be in llvm\Build\bin
>>
>> This gives me:
>>
>> CMake Error: The source directory
>> "C:/Programming/VersionControl/llvm/build" does not appear to contain
>> CMakeLists.txt.
>> Specify --help for usage, or press the help button on the CMake GUI.
>>
>> I do not see how you can build from a 'build" directory if CMake needs
>> to be in some other directory to generate its files.
>
> Did you miss the ".." at the end of the cmake command?

Two more notes:

If you want to build optimized binaries, use

cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release ..

When you are using makefiles, it is a good thing to specify if you want
optimized or debug binaries.

Second, for MinGW makefiles instead of `make' maybe you need
`mingw32-make'. Or just use

cmake --build .

(note the last dot) which invokes the build tool for you.




More information about the cfe-dev mailing list