Fix cmake drogonctl crosscompile (#654)

This commit is contained in:
ivanka2012 2020-12-13 15:12:01 +01:00 committed by GitHub
parent 566297d4df
commit d2f291689d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 2 deletions

View File

@ -1,9 +1,21 @@
cmake_minimum_required(VERSION 3.5)
project(drogon)
message(STATUS "compiler: " ${CMAKE_CXX_COMPILER_ID})
option(BUILD_CTL "Build drogon_ctl" ON)
option(BUILD_EXAMPLES "Build examples" ON)
include(CheckCXXSourceRuns)
check_cxx_source_runs(
${PROJECT_SOURCE_DIR}/cmake/tests/binary_compatibility_test.cc
cross_compiling)
if(cross_compiling)
set(BUILD_PROGRAMS OFF)
else(cross_compiling)
set(BUILD_PROGRAMS ON)
endif()
option(BUILD_CTL "Build drogon_ctl" ${BUILD_PROGRAMS})
option(BUILD_EXAMPLES "Build examples" ${BUILD_PROGRAMS})
option(BUILD_ORM "Build orm" ON)
option(COZ_PROFILING "Use coz for profiling" OFF)
option(LIBPQ_BATCH_MODE "Use batch mode for libpq" ON)

View File

@ -0,0 +1,4 @@
#include <algorithm>
int main(){
return std::abs(-42);
}