Skip to content

Commit

Permalink
[build][cygwin] Ensure tests for runner builds and runs
Browse files Browse the repository at this point in the history
  • Loading branch information
thoni56 committed Jul 4, 2022
1 parent 8c99e77 commit 07ae766
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 5 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,18 +80,18 @@ endif()
include(ConfigureChecks.cmake)
configure_file(config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)

# check subdirectories
add_subdirectory(src)
add_subdirectory(doc)
add_subdirectory(include)

# Dependency on our own library so we can use CGREEN_LIBRARY in all subdirectories
if (CGREEN_WITH_STATIC_LIBRARY)
set(CGREEN_LIBRARY ${CGREEN_STATIC_LIBRARY})
else ()
set(CGREEN_LIBRARY ${CGREEN_SHARED_LIBRARY})
endif()

# check subdirectories
add_subdirectory(src)
add_subdirectory(doc)
add_subdirectory(include)

if (CGREEN_WITH_UNIT_TESTS)
include(MacroAddUnitTest)
include(MacroAddTest)
Expand Down
4 changes: 3 additions & 1 deletion tools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ if (NM_FOUND)
cmake_define_relative_file_paths("${RUNNER_SRCS}")

add_executable(cgreen-runner ${RUNNER_SRCS})
target_link_libraries(cgreen-runner ${CGREEN_SHARED_LIBRARY} ${CMAKE_DL_LIBS})
target_link_libraries(cgreen-runner ${CGREEN_LIBRARY} ${CMAKE_DL_LIBS})

install(TARGETS cgreen-runner
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
Expand All @@ -39,8 +39,10 @@ if (NM_FOUND)
)
set(RUNNER_TESTS_SRCS
runner_unit_tests.c
test_item.c
)
add_library(${CGREEN_RUNNER_TESTS_LIBRARY} SHARED ${RUNNER_TESTS_SRCS})
target_link_libraries(${CGREEN_RUNNER_TESTS_LIBRARY} ${CGREEN_LIBRARY})

# Due to some (of many) CMake irregularities to reference the test libraries
# we can't just use its CMake name variable, but have to look it up with
Expand Down

0 comments on commit 07ae766

Please sign in to comment.