mirror of
				https://github.com/Z3Prover/z3
				synced 2025-11-04 05:19:11 +00:00 
			
		
		
		
	* github action: add riscv64/aarch64/powerpc64 cross compile Signed-off-by: Han Gao <rabenda.cn@gmail.com> * fix: build on non-x86 platform Signed-off-by: Revy <rabenda.cn@gmail.com>
		
			
				
	
	
		
			23 lines
		
	
	
	
		
			594 B
		
	
	
	
		
			CMake
		
	
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
	
		
			594 B
		
	
	
	
		
			CMake
		
	
	
	
	
	
set(ATOMIC_TEST_SOURCE "
 | 
						|
#include <atomic>
 | 
						|
std::atomic<int> x;
 | 
						|
std::atomic<short> y;
 | 
						|
std::atomic<char> z;
 | 
						|
std::atomic<long long> w;
 | 
						|
int main() {
 | 
						|
	++z;
 | 
						|
	++y;
 | 
						|
    ++w;
 | 
						|
	return ++x;
 | 
						|
}")
 | 
						|
CHECK_CXX_SOURCE_COMPILES("${ATOMIC_TEST_SOURCE}" BUILTIN_ATOMIC)
 | 
						|
if (NOT BUILTIN_ATOMIC)
 | 
						|
  set(CMAKE_REQUIRED_LIBRARIES atomic)
 | 
						|
  CHECK_CXX_SOURCE_COMPILES("${ATOMIC_TEST_SOURCE}" ATOMICS_REQUIRE_LIBATOMIC)
 | 
						|
  unset(CMAKE_REQUIRED_LIBRARIES)
 | 
						|
  if (ATOMICS_REQUIRE_LIBATOMIC)
 | 
						|
    list(APPEND Z3_DEPENDENT_LIBS atomic)
 | 
						|
  else()
 | 
						|
    message(FATAL_ERROR "Host compiler must support std::atomic!")
 | 
						|
  endif()
 | 
						|
endif()
 |