mirror of
https://github.com/drogonframework/drogon.git
synced 2025-08-29 00:02:44 -04:00
Fix cmake drogonctl crosscompile (#654)
This commit is contained in:
parent
566297d4df
commit
d2f291689d
@ -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)
|
||||
|
4
cmake/tests/binary_compability_test.cc
Normal file
4
cmake/tests/binary_compability_test.cc
Normal file
@ -0,0 +1,4 @@
|
||||
#include <algorithm>
|
||||
int main(){
|
||||
return std::abs(-42);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user