Page MenuHomePhabricator

[Native] Cleanup Cryptotools/CMakeLists.txt
ClosedPublic

Authored by jon on Aug 30 2022, 2:50 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Dec 20, 3:28 AM
Unknown Object (File)
Fri, Dec 20, 3:28 AM
Unknown Object (File)
Fri, Dec 20, 3:26 AM
Unknown Object (File)
Fri, Dec 20, 3:01 AM
Unknown Object (File)
Sun, Dec 8, 1:55 PM
Unknown Object (File)
Sun, Nov 24, 10:37 AM
Unknown Object (File)
Nov 22 2024, 5:05 AM
Unknown Object (File)
Nov 21 2024, 11:30 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