Page MenuHomePhabricator

[Native] Cleanup Cryptotools/CMakeLists.txt
ClosedPublic

Authored by jon on Aug 30 2022, 2:50 PM.
Tags
None
Referenced Files
F2833057: D4986.diff
Sat, Sep 28, 6:36 AM
Unknown Object (File)
Mon, Sep 23, 10:29 AM
Unknown Object (File)
Sat, Sep 14, 1:00 AM
Unknown Object (File)
Tue, Sep 10, 11:07 PM
Unknown Object (File)
Mon, Sep 9, 1:35 AM
Unknown Object (File)
Sat, Sep 7, 1:12 PM
Unknown Object (File)
Sat, Aug 31, 11:14 PM
Unknown Object (File)
Aug 28 2024, 7:15 AM
Subscribers

Details

Summary

When adding the the CMakeLists.txt, I wasn't able to
reference the other sibling projects. This change is to remove
the target_include_directories entries in favor
of using target_link_library which is the more canonical way
to reference other projects now that they exist.

Test Plan
nix develop
cd native/cpp/CommonCpp
rm -rf build && mkdir build && cd build && cmake .. && make -j

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

[100%] Built target comm-client

Sweet!

This revision is now accepted and ready to land.Aug 30 2022, 3:18 PM
atul requested changes to this revision.Aug 30 2022, 3:23 PM

Getting the following when I try this in native/cpp/CommonCpp/CryptoTools which I'm guessing is the directory I should be in given the diff title:

[ 75%] Building CXX object CMakeFiles/comm-cryptotools.dir/Session.cpp.o
/Users/atul/comm/native/cpp/CommonCpp/CryptoTools/Session.cpp:2:10: fatal error: 'PlatformSpecificTools.h' file not found
#include "PlatformSpecificTools.h"
         ^~~~~~~~~~~~~~~~~~~~~~~~~
/Users/atul/comm/native/cpp/CommonCpp/CryptoTools/Tools.cpp:2:10: fatal error: 'PlatformSpecificTools.h' file not found
#include "PlatformSpecificTools.h"
         ^~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
1 error generated.
make[2]: *** [CMakeFiles/comm-cryptotools.dir/Session.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [CMakeFiles/comm-cryptotools.dir/Tools.cpp.o] Error 1
/Users/atul/comm/native/cpp/CommonCpp/CryptoTools/CryptoModule.cpp:2:10: fatal error: 'PlatformSpecificTools.h' file not found
#include "PlatformSpecificTools.h"
         ^~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [CMakeFiles/comm-cryptotools.dir/CryptoModule.cpp.o] Error 1
make[1]: *** [CMakeFiles/comm-cryptotools.dir/all] Error 2
make: *** [all] Error 2
This revision now requires changes to proceed.Aug 30 2022, 3:23 PM

Getting the following when I try this in native/cpp/CommonCpp/CryptoTools which I'm guessing is the directory I should be in given the diff title:

This is by design. The idea is that people just need to reference CommonCpp and pulling out the needed project. Since they are all so coupled, it's not much of a loss. Being able to build the project from the directory itself was just to be able to get the majority of the CMake logic merged.

As mentioned in the summary:

This change is to remove the target_include_directories entries in favor of using target_link_library which is the more canonical way to reference other projects now that they exist.

The target_include_directoriesworked because we only used code located in headers, if we wanted to use headers and source files then the changes here are the correct way to reference other projects.

Thanks for the explanation, was able to build as expected!

This revision is now accepted and ready to land.Aug 31 2022, 7:34 PM