Skip to content

Commit

Permalink
build grid synth if gmp is detected
Browse files Browse the repository at this point in the history
  • Loading branch information
vsoftco committed Sep 21, 2023
1 parent c83e6d3 commit 018717b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
8 changes: 0 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,6 @@ add_compile_definitions(STAQ_VERSION_STR="${STAQ_VERSION_STR}")
#### staq root directory
add_compile_definitions(PROJECT_ROOT_DIR="${PROJECT_SOURCE_DIR}")

#### grid synth
option(BUILD_GRID_SYNTH "Builds staq_grid_synth, requires GMP" OFF)
if (${BUILD_GRID_SYNTH})
message(STATUS "Builds staq_grid_synth - ON")
else ()
message(STATUS "Builds staq_grid_synth - OFF")
endif ()

#### Force clang to use libc++
if (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
Expand Down
20 changes: 13 additions & 7 deletions tools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,22 @@ file(GLOB FILENAMES *.cpp)

add_custom_target(tools COMMENT "Build all binary tools.")

if (${BUILD_GRID_SYNTH})
if (MSVC)
# gmp, gmpxx
find_package(PkgConfig REQUIRED)
set(BUILD_GRID_SYNTH OFF)
if (MSVC)
# gmp, gmpxx
find_package(PkgConfig REQUIRED)
if (PkgConfig_FOUND)
pkg_check_modules(gmp REQUIRED IMPORTED_TARGET gmp)
pkg_check_modules(gmpxx REQUIRED IMPORTED_TARGET gmpxx)
else ()
find_package(GMP REQUIRED)
set(BUILD_GRID_SYNTH ON)
add_compile_options("-DEXPR_GMP")
endif ()
else ()
find_package(GMP REQUIRED)
if (GMP_FOUND)
set(BUILD_GRID_SYNTH ON)
add_compile_options("-DEXPR_GMP")
endif ()
add_compile_options("-DEXPR_GMP")
endif ()

foreach (filename ${FILENAMES})
Expand Down

0 comments on commit 018717b

Please sign in to comment.