Find perl using the CMake's standard FindPerl module.

This gives a standard PERL_EXECUTABLE configuration knob which is useful for
specifying a perl to use without having it in PATH.

Change-Id: I4b196b77e0b4666081a3f291fee3654c47925844
Reviewed-on: https://boringssl-review.googlesource.com/3570
Reviewed-by: Adam Langley <agl@google.com>
This commit is contained in:
David Benjamin 2015-02-23 13:06:19 -05:00 committed by Adam Langley
parent 87c8a643e1
commit 3ce3c369cb
3 changed files with 7 additions and 6 deletions

View File

@ -3,7 +3,8 @@ Build Prerequisites:
* CMake[1] 2.8.8 or later is required.
* Perl 5.6.1 or later is required. On Windows, Strawberry Perl and MSYS Perl
have both been reported to work.
have both been reported to work. If not found by CMake, it may be configured
explicitly by setting PERL_EXECUTABLE.
* On Windows you currently must use Ninja[2] to build; on other platforms,
it is not required, but recommended, because it makes builds faster.
@ -11,7 +12,8 @@ Build Prerequisites:
* If you need to build Ninja from source, then a recent version of
Python[3] is required (Python 2.7.5 works).
* On Windows only, Yasm[4] is required.
* On Windows only, Yasm[4] is required. If not found by CMake, it may be
configured explicitly by setting CMAKE_ASM_NASM_COMPILER.
* A C compiler is required. On Windows, MSVC 12 (Visual Studio 2013) or later
with Platform SDK 8.1 or later are supported. Recent versions of GCC and
@ -70,7 +72,4 @@ Known Limitations on Windows:
[4] http://yasm.tortall.net/
Either ensure yasm.exe is in %PATH% or configure CMAKE_ASM_NASM_COMPILER
appropriately.
[5] https://golang.org/dl/

View File

@ -2,6 +2,8 @@ cmake_minimum_required (VERSION 2.8.10)
project (BoringSSL)
find_package(Perl REQUIRED)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror -ggdb -fvisibility=hidden")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -ggdb -std=c++0x -fvisibility=hidden")

View File

@ -37,7 +37,7 @@ endif()
function(perlasm dest src)
add_custom_command(
OUTPUT ${dest}
COMMAND perl ${CMAKE_CURRENT_SOURCE_DIR}/${src} ${PERLASM_STYLE} ${PERLASM_FLAGS} ${ARGN} > ${dest}
COMMAND ${PERL_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/${src} ${PERLASM_STYLE} ${PERLASM_FLAGS} ${ARGN} > ${dest}
DEPENDS
${src}
${PROJECT_SOURCE_DIR}/crypto/perlasm/x86_64-xlate.pl