Skip to content

Commit 378b5cf

Browse files
Copilothsluoyz
andcommitted
Fix nlohmann_json linkage from PRIVATE to PUBLIC
Change target_link_libraries for nlohmann_json from PRIVATE to PUBLIC since nlohmann::json types are exposed in public headers (casbin_types.h, evaluator.h, and data_types.h). This ensures proper propagation of the dependency to downstream consumers and prevents ABI mismatches when multiple versions of nlohmann_json are present. Co-authored-by: hsluoyz <3787410+hsluoyz@users.noreply.github.com>
1 parent 15307c7 commit 378b5cf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

casbin/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ add_library(casbin STATIC ${CASBIN_SOURCE_FILES})
7777

7878
target_precompile_headers(casbin PRIVATE ${CASBIN_INCLUDE_DIR}/casbin/pch.h)
7979
target_include_directories(casbin PRIVATE ${CASBIN_INCLUDE_DIR})
80-
target_link_libraries(casbin PRIVATE nlohmann_json::nlohmann_json)
80+
target_link_libraries(casbin PUBLIC nlohmann_json::nlohmann_json)
8181

8282
set_target_properties(casbin PROPERTIES
8383
PREFIX ""

0 commit comments

Comments
 (0)