Skip to content
Snippets Groups Projects
Commit 2ea31820 authored by Florian Loitsch's avatar Florian Loitsch
Browse files

Add fPIC flag on x86_64 if the compiler supports it.

Fixes #34.
parent 28d0d6b1
No related branches found
No related tags found
No related merge requests found
set(headers
bignum.h
cached-powers.h
......@@ -25,6 +24,14 @@ ${headers}
target_include_directories(double-conversion PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>)
# Add fPIC on x86_64 when supported.
include(CheckCXXCompilerFlag)
check_cxx_compiler_flag(-fPIC CXX_HAS_FPIC)
if(CXX_HAS_FPIC AND CMAKE_SYSTEM_PROCESSOER STREQUAL "x86_64")
set_target_properties(double-conversion PROPERTIES COMPILE_FLAGS "-fPIC")
endif()
#
# associates the list of headers with the library
# for the purposes of installation/import into other projects
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment