Build on AWS Linux so C++ library does not need to be packaged

This commit is contained in:
Bertold Van den Bergh 2019-12-03 17:01:36 +01:00
parent 6db9dca021
commit abba171e96
2 changed files with 7 additions and 6 deletions

View file

@ -5,4 +5,4 @@ project(timezone LANGUAGES CXX C)
find_package(aws-lambda-runtime REQUIRED)
add_executable(${PROJECT_NAME} ../library/zonedetect.c main.cpp)
target_link_libraries(${PROJECT_NAME} PUBLIC AWS::aws-lambda-runtime)
aws_lambda_package_target(${PROJECT_NAME})
aws_lambda_package_target(${PROJECT_NAME} NO_LIBC)

View file

@ -1,15 +1,17 @@
version: 0.2
phases:
install:
runtime-versions:
golang: 1.13 #Dummy, as this is a required parameter
pre_build:
commands:
- apt update
- apt install -y cmake git
- yum install -y cmake3 git gcc gcc-c++ make
- git clone https://github.com/awslabs/aws-lambda-cpp.git
- cd aws-lambda-cpp
- mkdir build
- cd build
- cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=~/out
- cmake3 .. -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=~/out
- make && make install
- cd ../../
build:
@ -17,7 +19,7 @@ phases:
- cd aws_lambda
- mkdir build
- cd build
- cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=~/out
- cmake3 .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=~/out
- make -j 4 aws-lambda-package-timezone
post_build:
commands:
@ -32,4 +34,3 @@ artifacts:
files:
- '**/*'
base-directory: aws_lambda/build/output/