From df3e4ee295b981100ff033655607679508404fcc Mon Sep 17 00:00:00 2001 From: Alexander Kutsan Date: Thu, 2 Mar 2017 09:50:10 +0000 Subject: [PATCH 1/6] Fix detecting arhitecture on raspberry pi Detect arhotecture depending on size of void Related to #1329 --- tools/cmake/helpers/platform.cmake | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/tools/cmake/helpers/platform.cmake b/tools/cmake/helpers/platform.cmake index a377dfd042b..023cd7e8791 100644 --- a/tools/cmake/helpers/platform.cmake +++ b/tools/cmake/helpers/platform.cmake @@ -74,20 +74,16 @@ function(get_os OS) endfunction() function(get_arch ARCH) - if(ARCH_X86) + if( CMAKE_SIZEOF_VOID_P MATCHES 8 ) + # void ptr = 8 byte --> x86_64 + set(${ARCH} "x86_64" PARENT_SCOPE) + elseif( CMAKE_SIZEOF_VOID_P MATCHES 4 ) + # void ptr = 4 byte --> x86 set(${ARCH} "x86" PARENT_SCOPE) - elseif(ARCH_X64) - set(${ARCH} "x64" PARENT_SCOPE) else() - if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "i386") - set(${ARCH} "x86" PARENT_SCOPE) - elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64") - set(${ARCH} "x64" PARENT_SCOPE) - else() message(FATAL_ERROR "Unsupported architecture") - endif() - endif() -endfunction() + endif() +endfunction(get_arch ARCH) function(get_sdk SDK) if(SDK_QT) From d00b9592032b695d841ba5ceebd49976d2be48a2 Mon Sep 17 00:00:00 2001 From: Alex Kutsan Date: Fri, 3 Mar 2017 12:49:31 +0200 Subject: [PATCH 2/6] Set ARCH to x64 against x86_64 --- tools/cmake/helpers/platform.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/cmake/helpers/platform.cmake b/tools/cmake/helpers/platform.cmake index 023cd7e8791..14a29a67a87 100644 --- a/tools/cmake/helpers/platform.cmake +++ b/tools/cmake/helpers/platform.cmake @@ -76,7 +76,7 @@ endfunction() function(get_arch ARCH) if( CMAKE_SIZEOF_VOID_P MATCHES 8 ) # void ptr = 8 byte --> x86_64 - set(${ARCH} "x86_64" PARENT_SCOPE) + set(${ARCH} "x86" PARENT_SCOPE) elseif( CMAKE_SIZEOF_VOID_P MATCHES 4 ) # void ptr = 4 byte --> x86 set(${ARCH} "x86" PARENT_SCOPE) From d3a44111f88bbe41f7c35944f19b4eafe4dfd6bb Mon Sep 17 00:00:00 2001 From: Alex Kutsan Date: Mon, 6 Mar 2017 16:44:12 +0200 Subject: [PATCH 3/6] Fixed typo x86 -> x64 --- tools/cmake/helpers/platform.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/cmake/helpers/platform.cmake b/tools/cmake/helpers/platform.cmake index 14a29a67a87..961b41d6897 100644 --- a/tools/cmake/helpers/platform.cmake +++ b/tools/cmake/helpers/platform.cmake @@ -76,7 +76,7 @@ endfunction() function(get_arch ARCH) if( CMAKE_SIZEOF_VOID_P MATCHES 8 ) # void ptr = 8 byte --> x86_64 - set(${ARCH} "x86" PARENT_SCOPE) + set(${ARCH} "x64" PARENT_SCOPE) elseif( CMAKE_SIZEOF_VOID_P MATCHES 4 ) # void ptr = 4 byte --> x86 set(${ARCH} "x86" PARENT_SCOPE) From 5a70594cbc053230d8132516ac99339768e4a664 Mon Sep 17 00:00:00 2001 From: Alex Kutsan Date: Fri, 3 Mar 2017 11:32:09 +0200 Subject: [PATCH 4/6] Set Debug as default build In case if CMAKE_BUILD_TYPE didn't set, set CMAKE_BUILD_TYPE=Debug Note: Cotire incorrectly create united file in case if CMAKE_BUILD_TYPE is empty --- CMakeLists.txt | 8 ++------ src/appMain/CMakeLists.txt | 4 ---- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 07dd4e8bea5..a813b98a1c8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -65,7 +65,6 @@ if(EXTENDED_POLICY STREQUAL "") endif() set(OS_TYPE_OPTION "$ENV{OS_TYPE}") -set(DEBUG_OPTION "$ENV{DEBUG}") set(HMI_TYPE_OPTION "$ENV{HMI_TYPE}") set(TARGET_OPTION "$ENV{TARGET}") set(MEDIA_MODE_OPTION "$ENV{MEDIA_MODE}") @@ -110,11 +109,8 @@ if (MEDIA_MODE_OPTION) endif() endif() -if (DEBUG_OPTION) - if (${DEBUG_OPTION} STREQUAL "DBG_OFF") - message(STATUS "Jenkins integration: build release version") - set(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE) - endif() +if( NOT CMAKE_BUILD_TYPE ) + set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build. Options are: None, Debug, Release, RelWithDebInfo, MinSizeRel." FORCE) endif() if (HMI_ADAPTER_OPTION) diff --git a/src/appMain/CMakeLists.txt b/src/appMain/CMakeLists.txt index 88813b5bfb4..0b76be34b58 100644 --- a/src/appMain/CMakeLists.txt +++ b/src/appMain/CMakeLists.txt @@ -137,10 +137,6 @@ if(ENABLE_LOG) list(APPEND LIBRARIES expat -L${EXPAT_LIBS_DIRECTORY}) endif() -if( NOT CMAKE_BUILD_TYPE ) - set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build. Options are: None, Debug, Release, RelWithDebInfo, MinSizeRel." FORCE) -endif() - add_executable(${PROJECT} ${SOURCES}) target_link_libraries(${PROJECT} ${LIBRARIES}) From 30d73a1506411d7b779843a37dffc4bf759c32e2 Mon Sep 17 00:00:00 2001 From: Alex Kutsan Date: Fri, 3 Mar 2017 12:02:50 +0200 Subject: [PATCH 5/6] Improve a bit code of test scripts build moved redundant namespace in local scope Added test main to list of sources --- src/components/test_main.cc | 2 +- tools/cmake/helpers/sources.cmake | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/test_main.cc b/src/components/test_main.cc index 66013d78c46..72c90acb5cf 100644 --- a/src/components/test_main.cc +++ b/src/components/test_main.cc @@ -1,8 +1,8 @@ #include "gmock/gmock.h" #include "utils/logger.h" #include "utils/custom_string.h" -namespace custom_str = utils::custom_string; int main(int argc, char** argv) { + namespace custom_str = utils::custom_string; testing::InitGoogleMock(&argc, argv); ::testing::DefaultValue::Set( custom_str::CustomString("")); diff --git a/tools/cmake/helpers/sources.cmake b/tools/cmake/helpers/sources.cmake index 0315b905d93..657197eaacf 100644 --- a/tools/cmake/helpers/sources.cmake +++ b/tools/cmake/helpers/sources.cmake @@ -143,10 +143,11 @@ function(create_test NAME SOURCES LIBS) endfunction() function(create_cotired_test NAME SOURCES LIBS) + list(APPEND SOURCES + ${CMAKE_SOURCE_DIR}/src/components/test_main.cc) add_executable( ${NAME} EXCLUDE_FROM_ALL - ${CMAKE_SOURCE_DIR}/src/components/test_main.cc ${SOURCES} ) # TODO: Fix problems with Cotire on Windows and Qt APPLINK-28060 From ead2d483936b199ec7fddade159cc9c939785b87 Mon Sep 17 00:00:00 2001 From: Jacob Keeler Date: Tue, 16 May 2017 10:22:51 -0400 Subject: [PATCH 6/6] Renamed resumption test to avoid cmake warning --- src/components/application_manager/test/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/application_manager/test/CMakeLists.txt b/src/components/application_manager/test/CMakeLists.txt index 7a7ff12d41e..dba8d99a622 100644 --- a/src/components/application_manager/test/CMakeLists.txt +++ b/src/components/application_manager/test/CMakeLists.txt @@ -139,7 +139,7 @@ file(COPY smartDeviceLink_test.ini DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/resumption) file(COPY smartDeviceLink_test.ini DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/resumption) -create_test("resumption/data_resumption_test" "${ResumptionData_SOURCES}" "${LIBRARIES}") +create_test("data_resumption_test" "${ResumptionData_SOURCES}" "${LIBRARIES}") add_subdirectory(state_controller) add_subdirectory(app_launch)