Closed fire closed 7 years ago
Thanks for the offer. What do you propose? Would the CMake just trail behind a bit? Are you volunteering to maintain the CMake build system on all platforms?
Let me get a prototype cmake project running then and see.
I can maintain Cmake on Windows and maybe Linux. Not sure about iOS and Android or Mac.
Here is an initial cmake for Windows. The various executables compile but secure_server didn't run.
Todo:
Prefixed the executables with yojimbo because the test is a reserved project name.
No need to port:
Basically, I don't think it's necessary to port any of the "shortcuts" actions I've setup in premake to CMake. If you build a CMake version that just builds the libraries and test programs, and works on Windows, Linux, MacOSX that would be fine and I would accept that.
Also, that automatic build you mentioned for libsodium and mbedtls is a win for CMake vs. premake5, especially on Windows platform, and on more conservative Linux like Debian, where they aren't in any package manager.
cheers
Can you give more detail about secure_server? Why does it not run? It's important that works. Does secure_server run on your machine when you build it with premake instead?
secure server started on port 40000
but I don't know how to secure connect.
YOJIMBO_INSECURE_CONNECT does not compile when set to 0.
Also I would like some sort of YOJIMBO_SECURE_CONNECT_ONLY
that does not require me to force remove a definition.
For instance if I want to enable secure connections. All I want is to enable one flag.
add_executable(
yojimbo_client
yojimbo
tests/client.cpp
)
target_compile_definitions( yojimbo_client PRIVATE SECURE_CLIENT=1)
target_link_libraries(
yojimbo_client
yojimbo
)
Oh the secure connect is working fine. It's by design that the regular client cannot connect to the server, as it only allows secure connects through the matcher (eg. "premake5 matcher" followed by "premake5 connect").
cheers
I'm thinking about the YOJIMBO_SECURE_CONNECT_ONLY idea, it seems reasonable.
Replaced YOJIMBO_ALLOW_INSECURE_CONNECT with YOJIMBO_SECURE_MODE, and fixed the compile errors. I called it "secure mode" because I might hang other things off this define in future (eg. proper cert check for matcher), and I want yojimbo to be secure by default when YOJIMBO_SECURE_MODE 1 is true. https://github.com/networkprotocol/libyojimbo/commit/7e79844cfc229f054fdf7ee12263f3218fc281f3
Looks good. However the yojimbo secure client doesn't automatically connect to the server anymore. Not sure the details, but the code is empty.
"connect.cpp" was moved to "secure_client.cpp" so it's more obvious how to secure connect a client. Just rename the "connect" project to "secure_client" and build "secure_client.cpp" instead of "connect.cpp".
I also split apart "secure_server.cpp" from "server.cpp", because that code was getting hard to read, and it's more consistent. eg. client -> server, secure_client -> secure_server. You don't need to do the #define SECURE_SERVER 1 dance on server.cpp anymore, just build secure_server.cpp
Also, check out the latest premake5.lua in last commit, I added "Debug_Secure" and "Release_Secure" build configurations that #define YOJIMBO_SECURE_MODE 1 and added these configurations to the travis automatic build and test. This should make sure that secure mode stays compile error free (I don't usually build and test during development with secure mode enabled, so as I make unrelated changes, compile errors would creep in).
cheers
I'm closing this issue as it seems you should be unblocked. Let me know when you have a pull request with the CMake config that works with mbedtls and libsodium built through hunter. I'm happy to review it.
cheers
I found some time to work on this.
The cmake project now have sodium integrated with hunter. Just waiting on the other package.
Thanks!
Would you accept a cmake version of the build system? If I made one? Not sure how to deal with two versions of the build system though because one be outdated.