[PATCH] D106131: Fix FindZ3.cmake to support static libraries and Windows

Balázs Benics via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 25 06:35:39 PDT 2021


steakhal added reviewers: steveire, kbobyrev, JDevlieghere.
steakhal added a comment.

I'm also not really comfortable with CMake, thus I'm requesting review from others who might have more experience on CMake/Windows stuff.
Don't mind me if I missed someone :D
On my side, this patch works on Linux x86_64 though, it did not break anything.



================
Comment at: llvm/cmake/modules/FindZ3.cmake:17
   # The program that will be executed to print Z3's version.
-  file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testz3.c
+  file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testz3.cpp
        "#include <assert.h>
----------------
Do you need to change it to `cpp`?


================
Comment at: llvm/cmake/modules/FindZ3.cmake:43-44
+  else()
+    message(NOTICE "${COMPILE_OUTPUT}")
+    message(WARNING "Failed to compile Z3 program that is used to determine library version.")
   endif()
----------------
Ah, nice to see such an addition.


================
Comment at: llvm/cmake/modules/FindZ3.cmake:101-102
        z3_version_str REGEX "^#define[\t ]+Z3_BUILD_NUMBER[\t ]+.*")
-  string(REGEX REPLACE "^.*Z3_BUILD_VERSION[\t ]+([0-9]).*$" "\\1"
+  string(REGEX REPLACE "^.*Z3_BUILD_NUMBER[\t ]+([0-9]).*$" "\\1"
          Z3_BUILD "${z3_version_str}")
 
----------------
Oh, so it never matched. What is the purpose of this in that case?
If we did not recognize this sooner, I mean...


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D106131/new/

https://reviews.llvm.org/D106131



More information about the llvm-commits mailing list