Skip to content

Commit

Permalink
Fix the override for the compatible string
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-atom authored and patrislav1 committed Jul 31, 2023
1 parent 2d75301 commit 5786e5c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ include(CMakePackageConfigHelpers)

# mmcmb library

add_library(mmcmb SHARED mmcmb.c)
set_target_properties(mmcmb PROPERTIES PUBLIC_HEADER "mmcmb/mmcmb.h;mmcmb/mmcmb.hpp;mmcmb/fpga_mailbox_layout.h")
set_target_properties(mmcmb PROPERTIES VERSION ${PROJECT_VERSION})
target_compile_options(mmcmb PRIVATE -Wall -Wextra -O2)

# COMPAT_ID is the device tree "compatible=" identifier for the mailbox device
# Invoke cmake with e.g. -DCOMPAT_ID="desy,mmcmailbox" to override the default
if(COMPAT_ID)
message(STATUS "Set mailbox compat. ID to ${COMPAT_ID}")
target_compile_definitions(mmcmb PRIVATE MB_DT_COMPAT_ID="${COMPAT_ID}")
endif()

add_library(mmcmb SHARED mmcmb.c)
set_target_properties(mmcmb PROPERTIES PUBLIC_HEADER "mmcmb/mmcmb.h;mmcmb/mmcmb.hpp;mmcmb/fpga_mailbox_layout.h")
set_target_properties(mmcmb PROPERTIES VERSION ${PROJECT_VERSION})
target_compile_options(mmcmb PRIVATE -Wall -Wextra -O2)

configure_package_config_file(mmcmb-config.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/mmcmb-config.cmake
INSTALL_DESTINATION ${LIB_INSTALL_DIR}/cmake/mmcmb
Expand Down Expand Up @@ -66,4 +66,4 @@ add_custom_target(doc
drawio -x "doc/mmc-mailbox.drawio" -o "doc/mmc-mailbox.svg"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "Building documentation"
)
)

0 comments on commit 5786e5c

Please sign in to comment.