add PIP_BUILD_<MODULE> options for PIP build to force disabling modules
This commit is contained in:
@@ -94,6 +94,8 @@ set(PIP_EXPORTS)
|
|||||||
set(PIP_SRC_MODULES "console;crypt;compress;usb;fftw;opencl;io_utils;client_server;cloud;lua;http_client;http_server")
|
set(PIP_SRC_MODULES "console;crypt;compress;usb;fftw;opencl;io_utils;client_server;cloud;lua;http_client;http_server")
|
||||||
foreach(_m ${PIP_SRC_MODULES})
|
foreach(_m ${PIP_SRC_MODULES})
|
||||||
set(PIP_MSG_${_m} "no")
|
set(PIP_MSG_${_m} "no")
|
||||||
|
string(TOUPPER "${_m}" _mu)
|
||||||
|
option(PIP_BUILD_${_mu} "Build \"${_m}\" module" ON)
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
macro(pip_module NAME LIBS LABEL INCLUDES SOURCES MSG)
|
macro(pip_module NAME LIBS LABEL INCLUDES SOURCES MSG)
|
||||||
@@ -392,30 +394,37 @@ endif()
|
|||||||
if (NOT CROSSTOOLS)
|
if (NOT CROSSTOOLS)
|
||||||
if (NOT PIP_FREERTOS)
|
if (NOT PIP_FREERTOS)
|
||||||
|
|
||||||
|
if (PIP_BUILD_CONSOLE)
|
||||||
pip_module(console "" "PIP console support" "" "" "")
|
pip_module(console "" "PIP console support" "" "" "")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (PIP_BUILD_USB)
|
||||||
pip_find_lib(usb)
|
pip_find_lib(usb)
|
||||||
if(usb_FOUND)
|
if(usb_FOUND)
|
||||||
pip_module(usb "usb" "PIP usb support" "" "" "")
|
pip_module(usb "usb" "PIP usb support" "" "" "")
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
if (PIP_BUILD_COMPRESS)
|
||||||
pip_find_lib(zlib NAMES z zlib)
|
pip_find_lib(zlib NAMES z zlib)
|
||||||
if(zlib_FOUND)
|
if(zlib_FOUND)
|
||||||
pip_module(compress "zlib" "PIP compression support" "" "" "")
|
pip_module(compress "zlib" "PIP compression support" "" "" "")
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
if (PIP_BUILD_CRYPT)
|
||||||
pip_find_lib(sodium)
|
pip_find_lib(sodium)
|
||||||
if(sodium_FOUND)
|
if(sodium_FOUND)
|
||||||
pip_module(crypt "sodium" "PIP crypt support" "" "" "")
|
pip_module(crypt "sodium" "PIP crypt support" "" "" "")
|
||||||
pip_module(client_server "pip_io_utils" "PIP client-server helper" "" "" "")
|
pip_module(client_server "pip_io_utils" "PIP client-server helper" "" "" "")
|
||||||
pip_module(cloud "pip_io_utils" "PIP cloud support" "" "" "")
|
pip_module(cloud "pip_io_utils" "PIP cloud support" "" "" "")
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
if (PIP_BUILD_FFTW)
|
||||||
# Check if PIP support fftw3 for PIFFT using in math module
|
# Check if PIP support fftw3 for PIFFT using in math module
|
||||||
set(FFTW_LIB_NAME fftw3)
|
set(FFTW_LIB_NAME fftw3)
|
||||||
set(FFTW_LIB_SUFFIXES "" "f" "l" "q")
|
set(FFTW_LIB_SUFFIXES "" "f" "l" "q")
|
||||||
@@ -459,8 +468,10 @@ if (NOT CROSSTOOLS)
|
|||||||
if(FFTW_LIBS)
|
if(FFTW_LIBS)
|
||||||
pip_module(fftw "${FFTW_LIBS}" "PIP FFTW support" "" "" "")
|
pip_module(fftw "${FFTW_LIBS}" "PIP FFTW support" "" "" "")
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
if (PIP_BUILD_OPENCL)
|
||||||
if (NOT "x${MINGW_INCLUDE}" STREQUAL "x")
|
if (NOT "x${MINGW_INCLUDE}" STREQUAL "x")
|
||||||
list(APPEND CMAKE_INCLUDE_PATH "${MINGW_INCLUDE}")
|
list(APPEND CMAKE_INCLUDE_PATH "${MINGW_INCLUDE}")
|
||||||
endif()
|
endif()
|
||||||
@@ -472,15 +483,19 @@ if (NOT CROSSTOOLS)
|
|||||||
endif()
|
endif()
|
||||||
pip_module(opencl "OpenCL" "PIP OpenCL support" "${_opencl_inc}" "" " (${OpenCL_VERSION_STRING})")
|
pip_module(opencl "OpenCL" "PIP OpenCL support" "${_opencl_inc}" "" " (${OpenCL_VERSION_STRING})")
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
if (PIP_BUILD_IO_UTILS)
|
||||||
if(sodium_FOUND)
|
if(sodium_FOUND)
|
||||||
pip_module(io_utils "pip_crypt" "PIP I/O support" "" "" " (+crypt)")
|
pip_module(io_utils "pip_crypt" "PIP I/O support" "" "" " (+crypt)")
|
||||||
else()
|
else()
|
||||||
pip_module(io_utils "" "PIP I/O support" "" "" "")
|
pip_module(io_utils "" "PIP I/O support" "" "" "")
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
if (PIP_BUILD_LUA)
|
||||||
# Lua module
|
# Lua module
|
||||||
set(_lua_src_dir "${CMAKE_CURRENT_SOURCE_DIR}/3rd/lua")
|
set(_lua_src_dir "${CMAKE_CURRENT_SOURCE_DIR}/3rd/lua")
|
||||||
set(_lua_bri_dir "${CMAKE_CURRENT_SOURCE_DIR}/libs/lua/3rd")
|
set(_lua_bri_dir "${CMAKE_CURRENT_SOURCE_DIR}/libs/lua/3rd")
|
||||||
@@ -492,7 +507,10 @@ if (NOT CROSSTOOLS)
|
|||||||
endif()
|
endif()
|
||||||
list(APPEND HDR_DIRS "${_lua_bri_dir}/LuaBridge")
|
list(APPEND HDR_DIRS "${_lua_bri_dir}/LuaBridge")
|
||||||
list(APPEND HDRS ${_lua_src_hdr})
|
list(APPEND HDRS ${_lua_src_hdr})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
if (PIP_BUILD_HTTP_SERVER)
|
||||||
# libmicrohttpd
|
# libmicrohttpd
|
||||||
pip_find_lib(microhttpd HINTS "${MINGW_LIB}")
|
pip_find_lib(microhttpd HINTS "${MINGW_LIB}")
|
||||||
if (microhttpd_FOUND)
|
if (microhttpd_FOUND)
|
||||||
@@ -521,12 +539,17 @@ if (NOT CROSSTOOLS)
|
|||||||
#list(APPEND microhttpd_LIBRARIES "${_microhttpd_add_libs}")
|
#list(APPEND microhttpd_LIBRARIES "${_microhttpd_add_libs}")
|
||||||
pip_module(http_server "${_microhttpd_add_libs}" "PIP HTTP server" "" "" "")
|
pip_module(http_server "${_microhttpd_add_libs}" "PIP HTTP server" "" "" "")
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
if (PIP_BUILD_HTTP_CLIENT)
|
||||||
# libcurl
|
# libcurl
|
||||||
pip_find_lib(curl HINTS "${MINGW_LIB}")
|
pip_find_lib(curl HINTS "${MINGW_LIB}")
|
||||||
if (curl_FOUND)
|
if (curl_FOUND)
|
||||||
pip_module(http_client curl "PIP HTTP client" "" "" "")
|
pip_module(http_client curl "PIP HTTP client" "" "" "")
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
# Test program
|
# Test program
|
||||||
if(PIP_UTILS)
|
if(PIP_UTILS)
|
||||||
@@ -547,10 +570,20 @@ if (NOT CROSSTOOLS)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
else()
|
else()
|
||||||
|
|
||||||
|
if (PIP_BUILD_CRYPT)
|
||||||
pip_module(crypt "" "PIP crypt support" "" "" "")
|
pip_module(crypt "" "PIP crypt support" "" "" "")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (PIP_BUILD_COMPRESS)
|
||||||
pip_module(compress "" "PIP compression support" "" "" "")
|
pip_module(compress "" "PIP compression support" "" "" "")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (PIP_BUILD_IO_UTILS)
|
||||||
pip_module(io_utils "pip_crypt" "PIP I/O support" "" "" " (+crypt)")
|
pip_module(io_utils "pip_crypt" "PIP I/O support" "" "" " (+crypt)")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
string(REPLACE ";" "," PIP_EXPORTS_STR "${PIP_EXPORTS}")
|
string(REPLACE ";" "," PIP_EXPORTS_STR "${PIP_EXPORTS}")
|
||||||
|
|||||||
Reference in New Issue
Block a user