-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from sillydan1/dev
Release v3.0.4
- Loading branch information
Showing
3 changed files
with
30 additions
and
16 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 |
---|---|---|
|
@@ -29,6 +29,12 @@ set(CXX_STANDARD_REQUIRED ON) | |
# OPTIONS | ||
option(ENABLE_Z3 "Enables the download and compilation of the expr::z3_driver driver. OFF by default" OFF) | ||
|
||
get_cmake_property(_variableNames VARIABLES) | ||
list (SORT _variableNames) | ||
foreach (_variableName ${_variableNames}) | ||
message(STATUS "${_variableName}=${${_variableName}}") | ||
endforeach() | ||
|
||
# DEPENDENCIES | ||
# library dependencies | ||
CPMAddPackage("gh:yalibs/[email protected]") | ||
|
@@ -40,10 +46,13 @@ CPMAddPackage("gh:yalibs/[email protected]") | |
CPMAddPackage("gh:sillydan1/[email protected]") | ||
|
||
if(ENABLE_Z3) | ||
include(cmake/Z3.cmake) | ||
set(Z3_VERSION_NUMBER z3-4.12.2) | ||
get_z3_zip_file(${Z3_VERSION_NUMBER}) | ||
CPMAddPackage(NAME z3 VERSION ${Z3_VERSION_NUMBER} URL ${z3vstr}) | ||
find_package(Z3 REQUIRED) | ||
if(NOT Z3_FOUND) | ||
include(cmake/Z3.cmake) | ||
set(Z3_VERSION_NUMBER z3-4.13.0) | ||
get_z3_zip_file(${Z3_VERSION_NUMBER}) | ||
CPMAddPackage(NAME z3 VERSION ${Z3_VERSION_NUMBER} URL ${z3vstr}) | ||
endif() | ||
endif() | ||
|
||
set(${PROJECT_NAME}_BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR} CACHE STRING "expr_BUILD_DIR" FORCE) | ||
|
@@ -59,7 +68,7 @@ add_library(${PROJECT_NAME} SHARED | |
src/operations/pow.cpp | ||
src/operations/boolean.cpp | ||
src/driver/evaluator.cpp | ||
) | ||
) | ||
|
||
target_include_directories(${PROJECT_NAME} PUBLIC | ||
${CMAKE_CURRENT_BINARY_DIR} | ||
|
@@ -72,6 +81,8 @@ target_include_directories(${PROJECT_NAME} PUBLIC | |
${argvparse_SOURCE_DIR}/include | ||
${z3_SOURCE_DIR}/src/api/c++ | ||
${z3_SOURCE_DIR}/include | ||
${Z3_CXX_INCLUDE_DIRS} | ||
${Z3_C_INCLUDE_DIRS} | ||
src/symbol | ||
include | ||
src) | ||
|
@@ -85,25 +96,28 @@ target_include_directories(${PROJECT_NAME}_generic_driver PUBLIC | |
${yaoverload_SOURCE_DIR}/include | ||
${yahashcombine_SOURCE_DIR}/include | ||
${argvparse_SOURCE_DIR}/include | ||
${z3_SOURCE_DIR}/src/api/c++ | ||
${z3_SOURCE_DIR}/include | ||
${Z3_CXX_INCLUDE_DIRS} | ||
${Z3_C_INCLUDE_DIRS} | ||
src/symbol | ||
include | ||
src) | ||
|
||
add_subdirectory(src/expr-lang) | ||
|
||
if(ENABLE_Z3) | ||
target_sources(${PROJECT_NAME} PUBLIC src/driver/z3/z3-driver.cpp) | ||
target_link_directories(${PROJECT_NAME} PUBLIC ${z3_SOURCE_DIR}/bin) | ||
target_link_libraries(${PROJECT_NAME} z3) | ||
target_compile_definitions(${PROJECT_NAME} PUBLIC ENABLE_Z3) | ||
add_custom_target(copy_z3 COMMAND ${CMAKE_COMMAND} -E copy ${z3_SOURCE_DIR}/bin/libz3.* ${CMAKE_BINARY_DIR}) | ||
add_dependencies(${PROJECT_NAME} copy_z3) | ||
target_sources(${PROJECT_NAME} PUBLIC src/driver/z3/z3-driver.cpp) | ||
target_compile_definitions(${PROJECT_NAME} PUBLIC ENABLE_Z3) | ||
if(NOT Z3_FOUND) | ||
target_link_directories(${PROJECT_NAME} PUBLIC ${z3_SOURCE_DIR}/bin) | ||
target_link_libraries(${PROJECT_NAME} z3) | ||
add_custom_target(copy_z3 COMMAND ${CMAKE_COMMAND} -E copy ${z3_SOURCE_DIR}/bin/libz3.* ${CMAKE_BINARY_DIR}) | ||
add_dependencies(${PROJECT_NAME} copy_z3) | ||
else() | ||
target_link_libraries(${PROJECT_NAME} z3::libz3) | ||
endif() | ||
endif() | ||
|
||
add_executable(${PROJECT_NAME}_demo src/main.cpp) | ||
set_target_properties(${PROJECT_NAME}_demo PROPERTIES RPATH ${z3_SOURCE_DIR}/bin) | ||
target_link_libraries(${PROJECT_NAME}_demo ${PROJECT_NAME} expr_lang argvparse ${PROJECT_NAME}_generic_driver) | ||
target_link_libraries(${PROJECT_NAME}_generic_driver expr_lang) | ||
|
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 |
---|---|---|
|
@@ -92,7 +92,7 @@ unit: | |
|
||
statements: | ||
%empty { } | ||
| statement statements { } | ||
| statements statement { } | ||
; | ||
|
||
statement: | ||
|