Page MenuHomePhabricator

[Native] Cleanup Cryptotools/CMakeLists.txt
ClosedPublic

Authored by jon on Aug 30 2022, 2:50 PM.
Tags
None
Referenced Files
F2077072: D4986.id.diff
Sat, Jun 22, 9:10 AM
Unknown Object (File)
Fri, Jun 21, 5:19 AM
Unknown Object (File)
Wed, Jun 12, 6:49 PM
Unknown Object (File)
Sun, Jun 9, 10:54 PM
Unknown Object (File)
Wed, May 29, 12:25 PM
Unknown Object (File)
May 15 2024, 5:59 PM
Unknown Object (File)
May 15 2024, 5:59 PM
Unknown Object (File)
May 15 2024, 5:59 PM
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
Lint Not Applicable
Unit
Tests Not Applicable

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