Skip to content

Commit

Permalink
CMake: Add -mtune=generic option only if supported
Browse files Browse the repository at this point in the history
  • Loading branch information
chfast committed Feb 25, 2019
1 parent 441af90 commit 3601423
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## [0.4.4] - unreleased

- Fixed: [[#125](https://github.com/chfast/ethash/pull/125)]
Fix compilation on PowerPC architectures (-mtune=generic not supported there).

## [0.4.3] - 2019-02-19

- Added: [[#121](https://github.com/chfast/ethash/pull/121)]
Expand All @@ -22,6 +27,7 @@
- Added: Experimental support for [ProgPoW] [0.9.1][ProgPoW-changelog].


[0.4.4]: https://github.com/chfast/ethash/compare/v0.4.3...release/0.4
[0.4.3]: https://github.com/chfast/ethash/releases/tag/v0.4.3
[0.4.2]: https://github.com/chfast/ethash/releases/tag/v0.4.2
[0.4.1]: https://github.com/chfast/ethash/releases/tag/v0.4.1
Expand Down
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ethash: C/C++ implementation of Ethash, the Ethereum Proof of Work algorithm.
# Copyright 2018 Pawel Bylica.
# Copyright 2019 Pawel Bylica.
# Licensed under the Apache License, Version 2.0. See the LICENSE file.

cmake_minimum_required(VERSION 3.5)
Expand Down Expand Up @@ -43,9 +43,9 @@ if(CABLE_COMPILER_GNULIKE)
option(ETHASH_NATIVE "Build for native CPU" OFF)
if(ETHASH_NATIVE)
add_compile_options(-march=native)
elseif(NOT CMAKE_CROSSCOMPILING)
# Tune for currently most common CPUs (flag not supported in cross compilation).
add_compile_options(-mtune=generic)
else()
# Tune for currently most common CPUs.
cable_add_cxx_compiler_flag_if_supported(-mtune=generic)
endif()
elseif(MSVC AND CMAKE_SIZEOF_VOID_P EQUAL 4)
# For Win32 builds allow allocating more than 2 GB of memory.
Expand Down

0 comments on commit 3601423

Please sign in to comment.