-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #438, add three PDI deactivation option through CMake #543
base: main
Are you sure you want to change the base?
Conversation
… on forward declaration of Paraconf
…ointing toward FindPDI.cmake
…: without paraconf
Warning you're updating the tutorial. This is unrelated |
Use a `CMakeLists.txt` similar to `no-pdi_exampleTargetCMakeLists_findpackage.txt` for your target, | ||
then use the following: | ||
```bash | ||
cmake . -DCMAKE_MODULE_PATH="/<full>/<path>/<to>/pdi/no-pdi/cmake" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cmake . -DCMAKE_MODULE_PATH="/<full>/<path>/<to>/pdi/no-pdi/cmake" | |
cmake . -PDI_ROOT="/<full>/<path>/<to>/pdi/no-pdi/cmake" |
When switching from FindPDI to PDIConfig
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method implies modifying the user target CMakeLists, using :
include(${PDI_ROOT}/PDIConfig.cmake)
instead of :
find_package(PDI 1.0.0 REQUIRED COMPONENTS C)
pdi/docs/Using_PDI.md
Outdated
cmake . -DCMAKE_MODULE_PATH="/<full>/<path>/<to>/pdi/no-pdi/cmake" | ||
``` | ||
|
||
Alternatively, you can use the `include`/`target_include_directories` method, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively, you can use the `include`/`target_include_directories` method, | |
Alternatively, you can use the `add_subdirectory` method, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The example file does not have the text add_subdirectory
but include
.
pdi/docs/Using_PDI.md
Outdated
|
||
Alternatively, you can use the `include`/`target_include_directories` method, | ||
which does not require to pass an additional argument at compilation | ||
but requires to add ad option to the target `CMakeLists.txt`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but requires to add ad option to the target `CMakeLists.txt`, | |
but requires to slightly modify your `CMakeLists.txt`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Less precise. Needs to indicate the part of file which is concerned by the change. Edited for typo.
no-pdi/include/pdi.h
Outdated
*/ | ||
static inline const char* PDI_errmsg(void) | ||
{ | ||
return 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the result of the function is passed to printf, a null pointer will make it crash
no-pdi/CMakeLists.txt
Outdated
set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") | ||
|
||
# Find the PDI package | ||
find_package(PDI REQUIRED) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or just include()
it, it will be simpler
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is possible to change toward include(cmake/PDIConfig.cmake)
in this case, but to a target application's CMakeLists, an additional argument will be needed such as include(${PDI_ROOT}/PDIConfig.cmake)
, where previously find_package was used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A lot of files have moved. I don't think we need to separate the pdi/no-pdi tests.
Also, there seems to be a lot of commented out code which should be removed.
/** \addtogroup error | ||
* \{ | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Doxygen group, the same as pdi/include/pdi.h
static const PDI_errhandler_t PDI_NULL_HANDLER = {NULL, NULL}; | ||
|
||
/** Prints the error message and aborts if the status is invalid | ||
*/ | ||
static const PDI_errhandler_t PDI_ASSERT_HANDLER = PDI_NULL_HANDLER; | ||
|
||
/** Prints the error message and continue if the status is invalid | ||
*/ | ||
static const PDI_errhandler_t PDI_WARN_HANDLER = PDI_NULL_HANDLER; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are the default handlers right ? If this is the case, I don't think the values should be NULL as it cause a segfault. Is this tested ?
tests/add_all_tests.sh
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need to separate the pdi and no-pdi tests. This can be done inside the cmakelists.txt.
Missing the case where paraconf is missing.
List of things to check before making a PR
Before merging your code, please check the following:
.clang-format
;Fix #issue
keyword to autoclose the issue when merged.