Skip to content

CMake: Drop support for OPT_FLAGS #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 16, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 6 additions & 22 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ cmake_minimum_required(VERSION 2.8)

project (libff)

# Default to RelWithDebInfo configuration if no configuration is explicitly specified.
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Build type on single-configuration generators" FORCE)
endif()

set(
CURVE
"BN128"
Expand Down Expand Up @@ -81,14 +86,6 @@ option(
ON
)

set(
OPT_FLAGS
""
CACHE
STRING
"Override C++ compiler optimization flags"
)

if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
# Common compilation flags and warning configuration
set(
Expand All @@ -98,20 +95,8 @@ if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
if("${MULTICORE}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp")
endif()
# Default optimizations flags (to override, use -DOPT_FLAGS=...)
if("${OPT_FLAGS}" STREQUAL "")
set(
OPT_FLAGS
"-ggdb3 -O2 -march=native -mtune=native"
)
endif()
endif()

set(
CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} ${OPT_FLAGS}"
)

find_path(GMP_INCLUDE_DIR NAMES gmp.h)
find_library(GMP_LIBRARY gmp)
if(GMP_LIBRARY MATCHES ${CMAKE_SHARED_LIBRARY_SUFFIX})
Expand All @@ -127,9 +112,8 @@ set_target_properties(
INTERFACE_INCLUDE_DIRECTORIES ${GMP_INCLUDE_DIR}
)

include(FindPkgConfig)

if("${WITH_PROCPS}")
include(FindPkgConfig)
pkg_check_modules(
PROCPS
REQUIRED
Expand Down