-
Notifications
You must be signed in to change notification settings - Fork 193
add caam cmake example #361
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,8 @@ | ||
| This is an example of adding the wolfSSL library as a subdirectory to a project | ||
| and using cmake to build. | ||
| and using cmake to build. Each subdirectory has a README file on how to build the example. | ||
|
|
||
| ## Steps to build: | ||
|
|
||
| ``` | ||
| # clone or download the wolfssl bundle and put it in the subdirectory wolfssl | ||
| git clone https://github.com/wolfssl/wolfssl | ||
| mkdir build | ||
| cd build | ||
| cmake .. -DCMAKE_C_FLAGS=-I../include/ | ||
| make | ||
| ./hash example_string | ||
| ``` | ||
| ## Example Builds: | ||
|
|
||
| - user-settings-example (contains a very bare user_settings.h example) | ||
| - caam-nxp-example (contains an example of building with NXP SDK and CAAM) | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,154 @@ | ||||||||||||||||||
| set(CMAKE_SYSTEM_NAME Generic) | ||||||||||||||||||
| CMAKE_MINIMUM_REQUIRED (VERSION 3.10.0) | ||||||||||||||||||
|
|
||||||||||||||||||
| # ENABLE ASM | ||||||||||||||||||
| ENABLE_LANGUAGE(ASM) | ||||||||||||||||||
|
|
||||||||||||||||||
| set(CMAKE_STATIC_LIBRARY_PREFIX) | ||||||||||||||||||
| set(CMAKE_STATIC_LIBRARY_SUFFIX) | ||||||||||||||||||
|
|
||||||||||||||||||
| set(CMAKE_EXECUTABLE_LIBRARY_PREFIX) | ||||||||||||||||||
| set(CMAKE_EXECUTABLE_LIBRARY_SUFFIX) | ||||||||||||||||||
|
|
||||||||||||||||||
| set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}) | ||||||||||||||||||
| set(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}) | ||||||||||||||||||
|
|
||||||||||||||||||
| project(wolfssl-caam-example) | ||||||||||||||||||
|
|
||||||||||||||||||
| set(MCUX_SDK_PROJECT_NAME CSR_example_cm7.elf) | ||||||||||||||||||
|
|
||||||||||||||||||
| message("Example cmake project including wolfSSL for NXP CAAM") | ||||||||||||||||||
|
|
||||||||||||||||||
| # add global define to include user_settings.h | ||||||||||||||||||
| add_compile_definitions(WOLFSSL_USER_SETTINGS) | ||||||||||||||||||
| add_compile_definitions(CACHE_MODE_WRITE_THROUGH=1) | ||||||||||||||||||
| add_compile_definitions(CRYPTO_USE_DRIVER_CAAM) | ||||||||||||||||||
|
|
||||||||||||||||||
| set(BUILD_SHARED_LIBS OFF) | ||||||||||||||||||
| set(WOLFSSL_EXAMPLES OFF) | ||||||||||||||||||
| set(WOLFSSL_CRYPT_TESTS OFF) | ||||||||||||||||||
| set(WOLFSSL_CAAM ON) | ||||||||||||||||||
| set(WOLFSSL_USER_SETTINGS ON) | ||||||||||||||||||
| set(WOLFSSL_CONFIG_H OFF) | ||||||||||||||||||
|
|
||||||||||||||||||
| if (CONFIG_BIG_ENDIAN) | ||||||||||||||||||
| set(CMAKE_C_BYTE_ORDER BIG_ENDIAN) | ||||||||||||||||||
| set(CMAKE_CXX_BYTE_OREDER BIG_ENDIAN) | ||||||||||||||||||
| else () | ||||||||||||||||||
| set(CMAKE_C_BYTE_ORDER LITTLE_ENDIAN) | ||||||||||||||||||
| set(CMAKE_CXX_BYTE_OREDER LITTLE_ENDIAN) | ||||||||||||||||||
|
Comment on lines
+36
to
+39
|
||||||||||||||||||
| set(CMAKE_CXX_BYTE_OREDER BIG_ENDIAN) | |
| else () | |
| set(CMAKE_C_BYTE_ORDER LITTLE_ENDIAN) | |
| set(CMAKE_CXX_BYTE_OREDER LITTLE_ENDIAN) | |
| set(CMAKE_CXX_BYTE_ORDER BIG_ENDIAN) | |
| else () | |
| set(CMAKE_C_BYTE_ORDER LITTLE_ENDIAN) | |
| set(CMAKE_CXX_BYTE_ORDER LITTLE_ENDIAN) |
Copilot
AI
Feb 18, 2026
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.
Spelling error: "EXAMPE" should be "EXAMPLE".
Copilot
AI
Feb 18, 2026
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.
Spelling error: "boad" should be "board".
| # add in our application and boad files | |
| # add in our application and board files |
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 referenced directory name "user-settings-example" doesn't match the actual directory name "user-setttings-example" (which has three t's). Either the directory should be renamed to "user-settings-example" or this reference should be updated to "user-setttings-example".