Skip to content

Commit

Permalink
Fix MacOS issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Shadowrom2020 committed Sep 26, 2024
1 parent 3407598 commit 9f08f26
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ SET (LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin CACHE INTERNAL "Single output
include_directories("include/")
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
add_library(libcred "src/libcred_macos.cpp" "include/libcred.hpp")
target_link_libraries(libcred PRIVATE "-framework Foundation" "-framework Security")
elseif(WIN32)
add_library(libcred "src/libcred_win.cpp" "include/libcred.hpp")
elseif(UNIX)
Expand All @@ -48,9 +49,14 @@ endif()
# Build example
if(${BUILD_EXAMPLES})
add_executable(libcred_example1 "example/ex1.cpp")
target_link_libraries(libcred_example1 PRIVATE libcred)
add_executable(libcred_example2 "example/ex2.cpp")
target_link_libraries(libcred_example2 PRIVATE libcred)
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
target_link_libraries(libcred_example1 PRIVATE libcred "-framework Foundation" "-framework Security")
target_link_libraries(libcred_example2 PRIVATE libcred "-framework Foundation" "-framework Security")
else()
target_link_libraries(libcred_example1 PRIVATE libcred)
target_link_libraries(libcred_example2 PRIVATE libcred)
endif()
if(${BUILD_SHARED_LIBS})
target_compile_definitions(libcred_example1 PRIVATE "LIBCRED_EXPORTS=1")
target_compile_definitions(libcred_example2 PRIVATE "LIBCRED_EXPORTS=1")
Expand Down

0 comments on commit 9f08f26

Please sign in to comment.