File tree Expand file tree Collapse file tree 4 files changed +38
-18
lines changed Expand file tree Collapse file tree 4 files changed +38
-18
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,9 @@ if(UNIX)
4242
4343 # If supported for the target machine, emit position-independent code
4444 # suitable for dynamic linking.
45- set_property (TARGET pycasbin PROPERTY POSITION_INDEPENDENT_CODE ON )
45+ set_target_properties (pycasbin PROPERTIES
46+ POSITION_INDEPENDENT_CODE ON
47+ )
4648endif ()
4749
4850# macOS demands that the linker resolve all symbols at build time
Original file line number Diff line number Diff line change @@ -24,11 +24,17 @@ target_precompile_headers(casbin PUBLIC "pch.h")
2424
2525set (CMAKE_INSTALL_PREFIX ${CMAKE_SOURCE_DIR} )
2626
27- set_target_properties (casbin PROPERTIES PREFIX "" )
27+ set_target_properties (casbin PROPERTIES
28+ PREFIX ""
29+ )
30+
2831if (WIN32 OR MSVC )
2932 set_target_properties (casbin PROPERTIES SUFFIX ".lib" )
3033elseif (UNIX )
31- set_target_properties (casbin PROPERTIES SUFFIX ".a" )
34+ set_target_properties (casbin PROPERTIES
35+ SUFFIX ".a"
36+ POSITION_INDEPENDENT_CODE ON
37+ )
3238endif ()
3339
3440install (
Original file line number Diff line number Diff line change 1515if (CASBIN_BUILD_TEST)
1616 set (CMAKE_CXX_STANDARD 17)
1717
18- add_executable (
19- casbintest
20- built_in_functions_test.cpp
21- config_test.cpp
22- enforcer_test.cpp
23- enforcer_cached_test.cpp
24- enforcer_synced_test.cpp
25- management_api_test.cpp
26- model_enforcer_test.cpp
27- model_test.cpp
28- rbac_api_with_domains_test.cpp
29- rbac_api_test.cpp
30- role_manager_test.cpp
31- util_test.cpp
32- )
18+ add_executable (
19+ casbintest
20+ built_in_functions_test.cpp
21+ config_test.cpp
22+ enforcer_test.cpp
23+ enforcer_cached_test.cpp
24+ enforcer_synced_test.cpp
25+ management_api_test.cpp
26+ model_enforcer_test.cpp
27+ model_test.cpp
28+ rbac_api_with_domains_test.cpp
29+ rbac_api_test.cpp
30+ role_manager_test.cpp
31+ util_test.cpp
32+ )
33+
34+ if (UNIX )
35+ set_target_properties (casbintest PROPERTIES
36+ POSITION_INDEPENDENT_CODE ON
37+ )
38+ endif ()
3339
3440 target_include_directories (casbintest PUBLIC ${CMAKE_SOURCE_DIR} )
3541
Original file line number Diff line number Diff line change @@ -23,6 +23,12 @@ add_executable(casbin_benchmark
2323
2424target_include_directories (casbin_benchmark PUBLIC ${CMAKE_SOURCE_DIR} )
2525
26+ if (UNIX )
27+ set_target_properties (casbin_benchmark PROPERTIES
28+ POSITION_INDEPENDENT_CODE ON
29+ )
30+ endif ()
31+
2632target_link_libraries (
2733 casbin_benchmark
2834 benchmark
You can’t perform that action at this time.
0 commit comments