Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ include(cmake/FetchCMocka.cmake)

add_executable(CMockaExample main.c)
target_compile_features(CMockaExample PRIVATE c_std_99)
target_link_libraries(CMockaExample PRIVATE cmocka-static)
target_link_libraries(CMockaExample PRIVATE cmocka)

enable_testing()
add_test(NAME CMockaExample COMMAND CMockaExample)
add_test(NAME CMockaExample COMMAND CMockaExample)
6 changes: 3 additions & 3 deletions cmake/FetchCMocka.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ include(FetchContent)
FetchContent_Declare(
cmocka
GIT_REPOSITORY https://git.cryptomilk.org/projects/cmocka.git
GIT_TAG cmocka-1.1.5
GIT_TAG cmocka-1.1.8
GIT_SHALLOW 1
)

set(WITH_STATIC_LIB ON CACHE BOOL "CMocka: Build with a static library" FORCE)
set(BUILD_SHARED_LIBS OFF CACHE BOOL "CMocka: Build shared libraries" FORCE)
set(WITH_CMOCKERY_SUPPORT OFF CACHE BOOL "CMocka: Install a cmockery header" FORCE)
set(WITH_EXAMPLES OFF CACHE BOOL "CMocka: Build examples" FORCE)
set(UNIT_TESTING OFF CACHE BOOL "CMocka: Build with unit testing" FORCE)
set(PICKY_DEVELOPER OFF CACHE BOOL "CMocka: Build with picky developer flags" FORCE)

FetchContent_MakeAvailable(cmocka)
FetchContent_MakeAvailable(cmocka)