Skip to content

Commit 1365d97

Browse files
committed
fix: Build errors
Signed-off-by: Yash Pandey (YP) <[email protected]>
1 parent 0ea8a0a commit 1365d97

File tree

4 files changed

+69
-66
lines changed

4 files changed

+69
-66
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ endif()
3232
# Project definition.
3333

3434
project(CasbinCPP
35-
VERSION 1.36.0
35+
VERSION 1.37.0
3636
DESCRIPTION "An authorization library that supports access control models like ACL, RBAC, ABAC in C/C++"
3737
HOMEPAGE_URL https://github.com/casbin/casbin-cpp
3838
LANGUAGES CXX C

bindings/python/py_model.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,4 @@ void bindPyModel(py::module &m) {
5858
.def_static("NewModel", &casbin::Model::NewModel, "NewModel creates an empty model.")
5959
.def_static("NewModelFromFile", &casbin::Model::NewModelFromFile, "NewModelFromFile creates a model from a .CONF file.")
6060
.def_static("NewModelFromString", &casbin::Model::NewModelFromString, "NewModel creates a model from a std::string which contains model text.");
61-
62-
m.def("LoadModelFromConfig", &PyLoadModelFromConfig);
6361
}

casbin/CMakeLists.txt

Lines changed: 62 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -13,65 +13,65 @@
1313
# limitations under the License.
1414

1515
set(CASBIN_SOURCE
16-
abac_data.cpp
17-
enforcer.cpp
18-
enforcer_cached.cpp
19-
enforcer_synced.cpp
20-
internal_api.cpp
21-
logger.cpp
22-
management_api.cpp
23-
pch.cpp
24-
rbac_api.cpp
25-
rbac_api_with_domains.cpp
26-
config/config.cpp
27-
duktape/duktape.cpp
28-
effect/default_effector.cpp
29-
ip_parser/exception/parser_exception.cpp
30-
ip_parser/parser/allFF.cpp
31-
ip_parser/parser/CIDRMask.cpp
32-
ip_parser/parser/dtoi.cpp
33-
ip_parser/parser/equal.cpp
34-
ip_parser/parser/IP.cpp
35-
ip_parser/parser/IPNet.cpp
36-
ip_parser/parser/IPv4.cpp
37-
ip_parser/parser/parseCIDR.cpp
38-
ip_parser/parser/parseIP.cpp
39-
ip_parser/parser/parseIPv4.cpp
40-
ip_parser/parser/parseIPv6.cpp
41-
ip_parser/parser/Print.cpp
42-
ip_parser/parser/xtoi.cpp
43-
model/assertion.cpp
44-
model/function.cpp
45-
model/model.cpp
46-
model/scope_config.cpp
47-
persist/file_adapter/batch_file_adapter.cpp
48-
persist/file_adapter/file_adapter.cpp
49-
persist/file_adapter/filtered_file_adapter.cpp
50-
persist/adapter.cpp
51-
persist/default_watcher.cpp
52-
persist/default_watcher_ex.cpp
53-
rbac/default_role_manager.cpp
54-
util/array_equals.cpp
55-
util/array_remove_duplicates.cpp
56-
util/array_to_string.cpp
57-
util/built_in_functions.cpp
58-
util/ends_with.cpp
59-
util/escape_assertion.cpp
60-
util/find_all_occurences.cpp
61-
util/is_instance_of.cpp
62-
util/join.cpp
63-
util/join_slice.cpp
64-
util/remove_comments.cpp
65-
util/set_subtract.cpp
66-
util/split.cpp
67-
util/ticker.cpp
68-
util/trim.cpp
69-
)
16+
abac_data.cpp
17+
enforcer.cpp
18+
enforcer_cached.cpp
19+
enforcer_synced.cpp
20+
internal_api.cpp
21+
logger.cpp
22+
management_api.cpp
23+
pch.cpp
24+
rbac_api.cpp
25+
rbac_api_with_domains.cpp
26+
config/config.cpp
27+
duktape/duktape.cpp
28+
effect/default_effector.cpp
29+
ip_parser/exception/parser_exception.cpp
30+
ip_parser/parser/allFF.cpp
31+
ip_parser/parser/CIDRMask.cpp
32+
ip_parser/parser/dtoi.cpp
33+
ip_parser/parser/equal.cpp
34+
ip_parser/parser/IP.cpp
35+
ip_parser/parser/IPNet.cpp
36+
ip_parser/parser/IPv4.cpp
37+
ip_parser/parser/parseCIDR.cpp
38+
ip_parser/parser/parseIP.cpp
39+
ip_parser/parser/parseIPv4.cpp
40+
ip_parser/parser/parseIPv6.cpp
41+
ip_parser/parser/Print.cpp
42+
ip_parser/parser/xtoi.cpp
43+
model/assertion.cpp
44+
model/function.cpp
45+
model/model.cpp
46+
model/scope_config.cpp
47+
persist/file_adapter/batch_file_adapter.cpp
48+
persist/file_adapter/file_adapter.cpp
49+
persist/file_adapter/filtered_file_adapter.cpp
50+
persist/adapter.cpp
51+
persist/default_watcher.cpp
52+
persist/default_watcher_ex.cpp
53+
rbac/default_role_manager.cpp
54+
util/array_equals.cpp
55+
util/array_remove_duplicates.cpp
56+
util/array_to_string.cpp
57+
util/built_in_functions.cpp
58+
util/ends_with.cpp
59+
util/escape_assertion.cpp
60+
util/find_all_occurences.cpp
61+
util/is_instance_of.cpp
62+
util/join.cpp
63+
util/join_slice.cpp
64+
util/remove_comments.cpp
65+
util/set_subtract.cpp
66+
util/split.cpp
67+
util/ticker.cpp
68+
util/trim.cpp
69+
)
7070

7171
# Setting to C++ standard to C++17
7272
set(CMAKE_CXX_STANDARD 17)
7373

74-
add_library(casbin ${CASBIN_SOURCE})
74+
add_library(casbin STATIC ${CASBIN_SOURCE})
7575
target_include_directories(casbin PUBLIC ${CMAKE_SOURCE_DIR}/casbin)
7676

7777
target_precompile_headers(casbin PUBLIC "pch.h")
@@ -89,12 +89,13 @@ elseif(UNIX)
8989
)
9090
endif()
9191

92-
install(TARGETS casbin EXPORT CasbinTargets
93-
LIBRARY DESTINATION lib
94-
ARCHIVE DESTINATION lib
95-
RUNTIME DESTINATION bin
96-
INCLUDES DESTINATION include
97-
)
92+
install(
93+
TARGETS casbin EXPORT CasbinTargets
94+
LIBRARY DESTINATION lib
95+
ARCHIVE DESTINATION lib
96+
RUNTIME DESTINATION bin
97+
INCLUDES DESTINATION include
98+
)
9899

99100
install(
100101
DIRECTORY ${CMAKE_SOURCE_DIR}/include/casbin

include/casbin/casbin_helpers.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ namespace casbin {
5454
std::unordered_map<std::string, std::unordered_map<std::string, std::string>> data;
5555

5656
/**
57-
* addConfig adds a new section->key:value to the configuration.
57+
* addConfig adds a new section->key:value to the configuration.
5858
*/
5959
bool AddConfig(std::string section, const std::string& option, const std::string& value);
6060

@@ -82,6 +82,10 @@ namespace casbin {
8282

8383
bool GetBool(std::string_view key);
8484

85+
Config();
86+
87+
Config(const std::string& conf_name);
88+
8589
int GetInt(std::string_view key);
8690

8791
float GetFloat(std::string_view key);
@@ -206,7 +210,7 @@ namespace casbin {
206210
// LoadModelFromText loads the model from the text.
207211
void LoadModelFromText(const std::string& text);
208212

209-
void LoadModelFromConfig(std::shared_ptr<ConfigInterface> cfg);
213+
void LoadModelFromConfig(std::shared_ptr<Config>& cfg);
210214

211215
// PrintModel prints the model to the log.
212216
void PrintModel();

0 commit comments

Comments
 (0)