Skip to content

Commit

Permalink
Fix cygwin build
Browse files Browse the repository at this point in the history
  • Loading branch information
beutlich committed Jan 29, 2024
1 parent bd29471 commit 0580399
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Modelica/Resources/BuildProjects/CMake/src.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ endif()
if(MODELICA_DUMMY_FUNCTION_USERTAB OR BUILD_TESTING)
target_compile_definitions(ModelicaStandardTables PRIVATE -DDUMMY_FUNCTION_USERTAB=1)
endif()
if(MODELICA_BUILD_ZLIB AND (HAVE_WINAPIFAMILY_H OR HAVE_IO_H))
if(MODELICA_BUILD_ZLIB AND (HAVE_WINAPIFAMILY_H OR HAVE_IO_H) AND NOT CYGWIN)
target_compile_definitions(zlib PRIVATE -DWINAPI_FAMILY=100)
endif()
target_compile_definitions(ModelicaMatIO PRIVATE -DHAVE_ZLIB=1)
Expand Down
13 changes: 9 additions & 4 deletions Modelica/Resources/BuildProjects/CMake/test.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,18 @@ if(BUILD_TESTING)
)
foreach(TEST ${MODELICA_TESTS})
add_executable(Test${TEST} "${ABSOLUTE_MODELICA_TEST_SOURCE_DIR}/${TEST}.c")
target_link_libraries(Test${TEST} ModelicaExternalC ModelicaStandardTables ModelicaIO ModelicaMatIO zlib)
target_link_libraries(Test${TEST} ModelicaExternalC ModelicaStandardTables ModelicaIO ModelicaMatIO)
if(MODELICA_BUILD_ZLIB)
target_link_libraries(Test${TEST} zlib)
else()
target_link_libraries(Test${TEST} z)
endif()
add_test(NAME Test${TEST} COMMAND Test${TEST} WORKING_DIRECTORY "${ABSOLUTE_MODELICA_TEST_SOURCE_DIR}")
endforeach()
else()
message(WARNING
" Testsuite not found in \"${ABSOLUTE_MODELICA_TEST_SOURCE_DIR}\"."
" Set BUILD_TESTING to OFF to silence this warning."
)
" Testsuite not found in \"${ABSOLUTE_MODELICA_TEST_SOURCE_DIR}\"."
" Set BUILD_TESTING to OFF to silence this warning."
)
endif()
endif()

0 comments on commit 0580399

Please sign in to comment.