Skip to content

Commit

Permalink
Merge pull request monero-project#12 from electronero/cmake-patch
Browse files Browse the repository at this point in the history
Update CMakeLists.txt
  • Loading branch information
shopglobal authored Apr 19, 2018
2 parents 9e41bb4 + 9f9f520 commit 0456647
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,22 @@ function (die msg)
message(FATAL_ERROR "${BoldRed}${msg}${ColourReset}")
endfunction ()

function (add_definition_if_function_found function var)
string(REPLACE "-" "_" supported ${function}_function)
check_function_exists(${function} ${supported})
if(${${supported}})
add_definitions("-D${var}")
endif()
endfunction()

function (add_definition_if_library_exists library function header var)
string(REPLACE "-" "_" supported ${function}_library)
check_library_exists(${library} ${function} ${header} ${supported})
if(${${supported}})
add_definitions("-D${var}")
endif()
endfunction()

if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type" FORCE)
message(STATUS "Setting default build type: ${CMAKE_BUILD_TYPE}")
Expand Down

0 comments on commit 0456647

Please sign in to comment.