Skip to content

Commit

Permalink
cmake: Add missing check for __builtin_popcountll().
Browse files Browse the repository at this point in the history
The autoconf build system has this already.
  • Loading branch information
waywardmonkeys authored and zayenz committed Dec 4, 2023
1 parent 3fb05b3 commit 78f6a02
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,13 @@ if (HAVE_BUILTIN_FFSL)
set(GECODE_HAS_BUILTIN_FFSL "/**/")
endif ()

# Check for popcount
check_c_source_compiles("
int main() { return __builtin_popcountll(0); }" HAVE_BUILTIN_POPCOUNTLL)
if (HAVE_BUILTIN_POPCOUNTLL)
set(GECODE_HAS_BUILTIN_POPCOUNTLL "/**/")
endif ()

# Process config.hpp using autoconf rules.
list(LENGTH CONFIG length)
math(EXPR length "${length} - 1")
Expand Down

0 comments on commit 78f6a02

Please sign in to comment.