Skip to content
Snippets Groups Projects
Commit b8b2bbc4 authored by dmitriy.gerasimov's avatar dmitriy.gerasimov
Browse files

[*] Some SDK updates. More debug output

[+] BSD detection for cmake build files
[!] Rised CMake minimal required version to 3.0
parent cb8ea822
No related branches found
No related tags found
No related merge requests found
Pipeline #7168 passed with stages
in 6 minutes and 54 seconds
Subproject commit c5847bd09adb648a0eec0023744ca8c78b47fa08
Subproject commit 9eda788e45aec391cdae98e165a8aa8986bb6bba
......@@ -8,7 +8,7 @@ set(CMAKE_C_STANDARD 11)
SET( CPACK_PACKAGE_NAME "${PROJECT_NAME}")
SET( CPACK_PACKAGE_VERSION_MAJOR 4)
SET( CPACK_PACKAGE_VERSION_MINOR 3)
SET( CPACK_PACKAGE_VERSION_PATCH 24)
SET( CPACK_PACKAGE_VERSION_PATCH 25)
#
# init CellFrame SDK
......@@ -56,8 +56,10 @@ if(UNIX)
SET( CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
"${CMAKE_CURRENT_SOURCE_DIR}/debian/postinst;${CMAKE_CURRENT_SOURCE_DIR}/debian/postrm;${CMAKE_CURRENT_SOURCE_DIR}/debian/templates;${CMAKE_CURRENT_SOURCE_DIR}/debian/config;")
elseif(BSD)
message("[*] BSD family system ${CMAKE_SYSTEM} ")
else()
message("[!] Unix but not linux")
message("[!] Unknown UNIX")
endif()
else()
message("[ ] Not UNIX")
......
Subproject commit 1267dc73027196fadef922a6b32c654cfcc5c584
Subproject commit 7497bf2bd3cac45e82dc71e39ab619de4b03d7d7
......@@ -2,32 +2,29 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(OS_TYPE_DESKTOP ON)
set(LINUX ON)
set(UNIX ON)
EXECUTE_PROCESS( COMMAND arch COMMAND tr -d '\n' OUTPUT_VARIABLE OS_ARCH)
EXECUTE_PROCESS( COMMAND cat /etc/os-release COMMAND grep VERSION_CODENAME COMMAND sed s/VERSION_CODENAME=// COMMAND tr -d '\n' OUTPUT_VARIABLE L_DEBIAN_OS_NAME)
EXECUTE_PROCESS( COMMAND cat /etc/os-release COMMAND grep VERSION_ID COMMAND sed s/VERSION_ID=// COMMAND tr -d '\n' COMMAND sed s/\\x22// COMMAND sed s/\\x22// OUTPUT_VARIABLE L_DEBIAN_OS_VERSION)
SET(DEBIAN_OS_NAME "${L_DEBIAN_OS_NAME}")
SET(DEBIAN_OS_VERSION ${L_DEBIAN_OS_VERSION})
message("Debian OS ${DEBIAN_OS_VERSION} (${DEBIAN_OS_NAME})")
message("[ ] Debian OS ${DEBIAN_OS_VERSION} (${DEBIAN_OS_NAME})")
# check if we're building natively on Android (TERMUX)
EXECUTE_PROCESS( COMMAND uname -o COMMAND tr -d '\n' OUTPUT_VARIABLE OPERATING_SYSTEM)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Android")
message("ANDROID")
set(ANDROID ON)
set(UNIX ON)
set(LINUX ON)
set(LINUX OFF)
set(OS_TYPE_MOBILE ON)
message("ANDROID build")
message("[*] ANDROID build")
add_definitions(-DANDROID -DDAP_OS_ANDROID)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Win")
message("Win build")
set(OS_TYPE_DESKTOP ON)
endif()
if((CMAKE_BUILD_TYPE STREQUAL "Debug") OR (DAP_DEBUG))
message("Debug build")
message("[!] Debug build")
SET(DAP_DEBUG ON)
else()
message("Release build")
message("[!] Release build")
SET(DAP_RELEASE ON)
endif()
......@@ -43,38 +40,45 @@ if(BUILD_64)
else()
set(ARCH_WIDTH "32")
endif()
message(STATUS "Building for a ${ARCH_WIDTH}-bit system")
message(STATUS "[*] Building for a ${ARCH_WIDTH}-bit system")
if(UNIX)
add_definitions ("-DDAP_OS_LINUX -DDAP_OS_UNIX")
# add_definitions ("-DDAP_LOG_MT")
add_definitions ("-DDAP_OS_UNIX")
if (APPLE)
add_definitions ("-DDAP_OS_DARWIN -DDARWIN -DDAP_OS_BSD")
set(DARWIN ON)
endif()
if (${CMAKE_SYSTEM_NAME} MATCHES "BSD" )
add_definitions ("-DDAP_OS_BSD")
set(BSD ON)
endif()
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux" )
add_definitions ("-DDAP_OS_LINUX")
endif()
if(DAP_DEBUG)
set(_CCOPT "-DDAP_DEBUG -Wall -Wno-unused-function -Wno-implicit-fallthrough -Wno-unused-variable -Wno-unused-parameter -Wno-unused-but-set-variable -pg -g3 -ggdb -fno-eliminate-unused-debug-symbols")
set(_CCOPT "-DDAP_DEBUG -Wall -Wno-deprecated-declarations -Wno-unused-local-typedefs -Wno-unused-function -Wno-implicit-fallthrough -Wno-unused-variable -Wno-unused-parameter -Wno-unused-but-set-variable -pg -g3 -ggdb -fno-eliminate-unused-debug-symbols -fno-strict-aliasing")
set(_LOPT "-pg")
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -pg")
else()
set(_CCOPT "-Wno-unused-function -Wno-implicit-fallthrough -Wno-unused-variable -Wno-unused-parameter -Wno-unused-but-set-variable -O3 -fPIC -fno-ident -ffast-math -ftree-vectorize -fno-asynchronous-unwind-tables -ffunction-sections -Wl,--gc-sections -Wl,--strip-all -std=gnu11")
set(_CCOPT "-Wno-deprecated-declarations -Wno-unused-local-typedefs -Wno-unused-function -Wno-implicit-fallthrough -Wno-unused-variable -Wno-unused-parameter -Wno-unused-but-set-variable -O3 -fPIC -fno-strict-aliasing -fno-ident -ffast-math -ftree-vectorize -fno-asynchronous-unwind-tables -ffunction-sections -Wl,--gc-sections -Wl,--strip-all -std=gnu11")
endif()
if (ANDROID)
set(_CCOPT "${_CCOPT} -fforce-enable-int128 -std=gnu11")
add_definitions ("-DDAP_OS_ANDROID")
add_definitions ("-DDAP_OS_LINUX")
endif()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_CCOPT}")
set(CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} ${_LOPT}")
if (ANDROID)
add_subdirectory(lib/json-c)
add_subdirectory(lib/sqlite3)
#add_subdirectory(lib/libev)
include_directories(lib/)
else()
endif(ANDROID)
endif()
if(WIN32)
message(STATUS "Building for Windows")
message(STATUS "[*] Building for Windows")
add_definitions("-DHAVE_PREAD")
add_definitions("-DHAVE_MMAP")
add_definitions("-DHAVE_STRNDUP")
......@@ -94,10 +98,10 @@ if(WIN32)
add_definitions ("-DDAP_OS_WINDOWS")
if(DAP_DEBUG)
set(_CCOPT "-mconsole -static -Wall -std=gnu11 -Wextra -Wno-unused-function -Wno-implicit-fallthrough -Wno-unused-variable -Wno-unused-parameter -Wno-unused-but-set-variable -g3 -ggdb -fno-eliminate-unused-debug-symbols -pg")
set(_CCOPT "-mconsole -static -Wall -std=gnu11 -Wextra -Wno-deprecated-declarations -Wno-unused-local-typedefs -Wno-unused-function -Wno-implicit-fallthrough -Wno-unused-variable -Wno-unused-parameter -Wno-unused-but-set-variable -g3 -ggdb -fno-strict-aliasing -fno-eliminate-unused-debug-symbols -pg")
set(_LOPT "-mconsole -static -pg")
else()
set(_CCOPT "-static -std=gnu11 -Wall -Wextra -Wno-unused-function -Wno-implicit-fallthrough -Wno-unused-variable -Wno-unused-parameter -Wno-unused-but-set-variable -O3 -fno-ident -ffast-math -ftree-vectorize -mfpmath=sse -mmmx -msse2 -fno-asynchronous-unwind-tables -ffunction-sections -Wl,--gc-sections -Wl,--strip-all")
set(_CCOPT "-static -std=gnu11 -Wall -Wextra -Wno-deprecated-declarations -Wno-unused-local-typedefs -Wno-unused-function -Wno-implicit-fallthrough -Wno-unused-variable -Wno-unused-parameter -Wno-unused-but-set-variable -O3 -fno-ident -ffast-math -fno-strict-aliasing -ftree-vectorize -mfpmath=sse -mmmx -msse2 -fno-asynchronous-unwind-tables -ffunction-sections -Wl,--gc-sections -Wl,--strip-all")
endif()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_CCOPT} ")
......
Subproject commit 5f7f50045b26904da1cce15ab349c97d70e767bb
Subproject commit 02081d14b184f7a07a37f68a180a5ca21f01042e
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment