I am using cmake to try to build mbedtls. I got the .zip from github, un-zipped it, then I "cd"ed into the directory of mbedtls.
I get errors like these, no matter what subdirectory/directory im in i can not build it successfully.
the cmake command:
cmake Visual Studio 10 .
CMake Error at CMakeLists.txt:172 (add_library):
Cannot find source file:
error.c
Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm
.hpp .hxx .in .txx
CMake Error at CMakeLists.txt:172 (add_library):
No SOURCES given to target: mbedcrypto
this is the directory i am in. All the subdirectories/cmake files are there. my question is... How can i build mbedtls on windows?
Get a release rather than a snapshot of the development branch.
Alternatively, in the 3.0+ development branch, according to the readme:
The source code of Mbed TLS includes some files that are automatically generated by scripts and whose content depends only on the Mbed TLS source, not on the platform or on the library configuration. These files are not included in the development branch of Mbed TLS, but the generated files are included in official releases. (…)
Before running cmake
,
On Windows, run
scripts\make_generated_files.bat
to generate all the configuration-independent files.
This requires perl
, python
and a C compiler. You may need to set the CC
environment variable to the path to cl.exe
from Visual Studio.