diff options
author | Andres Noetzli <andres.noetzli@gmail.com> | 2021-06-17 19:22:19 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-18 02:22:19 +0000 |
commit | c3950d941da9753d2fb56eafa07be73a1a2ba500 (patch) | |
tree | 2f4df33c94d8473d0877f895e4617ba7e1fe1e20 /cmake | |
parent | 204d645e97bbacd948b5777b704f7b418577610a (diff) |
Fix CaDiCaL build on Windows (#6764)
The Windows version of CaDiCaL does not require the `sys/resource.h`
file, so this commit removes that check. It does, however, require
linking against the Process Status API (psapi), because of a call to
`GetProcessMemoryInfo()`, so this commit adds that dependency for
Windows builds.
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/FindCaDiCaL.cmake | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/cmake/FindCaDiCaL.cmake b/cmake/FindCaDiCaL.cmake index 80fa2e4ec..0c095a529 100644 --- a/cmake/FindCaDiCaL.cmake +++ b/cmake/FindCaDiCaL.cmake @@ -47,8 +47,6 @@ if(NOT CaDiCaL_FOUND_SYSTEM) include(CheckSymbolExists) include(ExternalProject) - fail_if_include_missing("sys/resource.h" "CaDiCaL") - set(CaDiCaL_VERSION "88623ef0866370448c34f6e320c148fc18e6f4cc") # avoid configure script and instantiate the makefile manually the configure @@ -110,6 +108,16 @@ set_target_properties( CaDiCaL PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${CaDiCaL_INCLUDE_DIR}" ) +if (WIN32) + # The Windows version of CaDiCaL calls GetProcessMemoryInfo(), which is + # defined in the Process Status API (psapi), so we declare it as a dependency + # of the CaDiCaL library (without this, linking a static cvc5 executable + # fails). + set_target_properties( + CaDiCaL PROPERTIES IMPORTED_LINK_INTERFACE_LIBRARIES psapi + ) +endif () + mark_as_advanced(CaDiCaL_FOUND) mark_as_advanced(CaDiCaL_FOUND_SYSTEM) mark_as_advanced(CaDiCaL_INCLUDE_DIR) |