-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
82 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
if(BITWUZLA_FOUND) | ||
return() | ||
endif() | ||
|
||
get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE) | ||
|
||
find_library(BITWUZLA_LIBRARY bitwuzla PATHS "${PACKAGE_PREFIX_DIR}/lib" NO_CACHE REQUIRED NO_DEFAULT_PATH) | ||
add_library(BITWUZLA::BITWUZLA STATIC IMPORTED) | ||
set_target_properties(BITWUZLA::BITWUZLA PROPERTIES | ||
IMPORTED_CONFIGURATIONS "NOCONFIG" | ||
IMPORTED_LOCATION_NOCONFIG "${BITWUZLA_LIBRARY}" | ||
INTERFACE_INCLUDE_DIRECTORIES "${PACKAGE_PREFIX_DIR}/include" | ||
) | ||
|
||
find_library(BITWUZLABB_LIBRARY bitwuzlabb PATHS "${PACKAGE_PREFIX_DIR}/lib" NO_CACHE REQUIRED NO_DEFAULT_PATH) | ||
add_library(BITWUZLA::BITWUZLABB STATIC IMPORTED) | ||
set_target_properties(BITWUZLA::BITWUZLABB PROPERTIES | ||
IMPORTED_CONFIGURATIONS "NOCONFIG" | ||
IMPORTED_LOCATION_NOCONFIG "${BITWUZLABB_LIBRARY}" | ||
INTERFACE_INCLUDE_DIRECTORIES "${PACKAGE_PREFIX_DIR}/include" | ||
) | ||
|
||
find_library(BITWUZLABV_LIBRARY bitwuzlabv PATHS "${PACKAGE_PREFIX_DIR}/lib" NO_CACHE REQUIRED NO_DEFAULT_PATH) | ||
add_library(BITWUZLA::BITWUZLABV STATIC IMPORTED) | ||
set_target_properties(BITWUZLA::BITWUZLABV PROPERTIES | ||
IMPORTED_CONFIGURATIONS "NOCONFIG" | ||
IMPORTED_LOCATION_NOCONFIG "${BITWUZLABV_LIBRARY}" | ||
INTERFACE_INCLUDE_DIRECTORIES "${PACKAGE_PREFIX_DIR}/include" | ||
) | ||
|
||
find_library(BITWUZLALS_LIBRARY bitwuzlals PATHS "${PACKAGE_PREFIX_DIR}/lib" NO_CACHE REQUIRED NO_DEFAULT_PATH) | ||
add_library(BITWUZLA::BITWUZLALS STATIC IMPORTED) | ||
set_target_properties(BITWUZLA::BITWUZLALS PROPERTIES | ||
IMPORTED_CONFIGURATIONS "NOCONFIG" | ||
IMPORTED_LOCATION_NOCONFIG "${BITWUZLALS_LIBRARY}" | ||
INTERFACE_INCLUDE_DIRECTORIES "${PACKAGE_PREFIX_DIR}/include" | ||
) | ||
|
||
set(BITWUZLA_FOUND ON) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
find_package(Python3 COMPONENTS Interpreter REQUIRED) | ||
message(STATUS "Python3: ${Python3_EXECUTABLE}") | ||
|
||
# TODO: pass compiler flags | ||
|
||
set(CONFIGURE_ARGS | ||
"--prefix" | ||
"<SOURCE_DIR>/install" | ||
"release" | ||
) | ||
|
||
if(BUILD_SHARED_LIBS) | ||
list(APPEND CONFIGURE_ARGS "--shared") | ||
else() | ||
list(APPEND CONFIGURE_ARGS "--static") | ||
endif() | ||
|
||
ExternalProject_Add(bitwuzla | ||
GIT_REPOSITORY | ||
"https://github.com/bitwuzla/bitwuzla" | ||
GIT_TAG | ||
"0.6.0" | ||
GIT_PROGRESS | ||
ON | ||
GIT_SHALLOW | ||
ON | ||
CMAKE_CACHE_ARGS | ||
${CMAKE_ARGS} | ||
BUILD_IN_SOURCE | ||
1 | ||
CONFIGURE_COMMAND | ||
"${Python3_EXECUTABLE}" "<SOURCE_DIR>/configure.py" ${CONFIGURE_ARGS} | ||
BUILD_COMMAND | ||
"ninja" "-C" "<SOURCE_DIR>/build" "install" | ||
INSTALL_COMMAND | ||
"${CMAKE_COMMAND}" -E copy_directory <SOURCE_DIR>/install "${CMAKE_INSTALL_PREFIX}" | ||
PREFIX | ||
bitwuzla-prefix | ||
) | ||
|
||
# TODO: generate BITWUZLAVersion.cmake as well file | ||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/BITWUZLAConfig.cmake.in" "${CMAKE_INSTALL_PREFIX}/lib/cmake/bitwuzla/BITWUZLAConfig.cmake" @ONLY) |