Skip to content

Commit 004f598

Browse files
authored
Merge pull request #1346 from LuxoftAKutsan/fix/avoid_undefined_reference_to_main_with_cotire
Avoid undefined reference to main with cotire
2 parents 01ddf8c + b1f40e1 commit 004f598

5 files changed

Lines changed: 6 additions & 13 deletions

File tree

CMakeLists.txt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ if(EXTENDED_POLICY STREQUAL "")
6565
endif()
6666

6767
set(OS_TYPE_OPTION "$ENV{OS_TYPE}")
68-
set(DEBUG_OPTION "$ENV{DEBUG}")
6968
set(HMI_TYPE_OPTION "$ENV{HMI_TYPE}")
7069
set(TARGET_OPTION "$ENV{TARGET}")
7170
set(MEDIA_MODE_OPTION "$ENV{MEDIA_MODE}")
@@ -110,11 +109,8 @@ if (MEDIA_MODE_OPTION)
110109
endif()
111110
endif()
112111

113-
if (DEBUG_OPTION)
114-
if (${DEBUG_OPTION} STREQUAL "DBG_OFF")
115-
message(STATUS "Jenkins integration: build release version")
116-
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE)
117-
endif()
112+
if( NOT CMAKE_BUILD_TYPE )
113+
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build. Options are: None, Debug, Release, RelWithDebInfo, MinSizeRel." FORCE)
118114
endif()
119115

120116
if (HMI_ADAPTER_OPTION)

src/appMain/CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,6 @@ if(ENABLE_LOG)
137137
list(APPEND LIBRARIES expat -L${EXPAT_LIBS_DIRECTORY})
138138
endif()
139139

140-
if( NOT CMAKE_BUILD_TYPE )
141-
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build. Options are: None, Debug, Release, RelWithDebInfo, MinSizeRel." FORCE)
142-
endif()
143-
144140
add_executable(${PROJECT} ${SOURCES})
145141
target_link_libraries(${PROJECT} ${LIBRARIES})
146142

src/components/application_manager/test/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ file(COPY smartDeviceLink_test.ini DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
173173

174174
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/resumption)
175175
file(COPY smartDeviceLink_test.ini DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/resumption)
176-
create_test("resumption/data_resumption_test" "${ResumptionData_SOURCES}" "${testLibraries}")
176+
create_test("data_resumption_test" "${ResumptionData_SOURCES}" "${testLibraries}")
177177

178178
add_subdirectory(state_controller)
179179
add_subdirectory(app_launch)

src/components/test_main.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#include "gmock/gmock.h"
22
#include "utils/logger.h"
33
#include "utils/custom_string.h"
4-
namespace custom_str = utils::custom_string;
54
int main(int argc, char** argv) {
5+
namespace custom_str = utils::custom_string;
66
testing::InitGoogleMock(&argc, argv);
77
::testing::DefaultValue<custom_str::CustomString>::Set(
88
custom_str::CustomString(""));

tools/cmake/helpers/sources.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,11 @@ function(create_test NAME SOURCES LIBS)
143143
endfunction()
144144

145145
function(create_cotired_test NAME SOURCES LIBS)
146+
list(APPEND SOURCES
147+
${CMAKE_SOURCE_DIR}/src/components/test_main.cc)
146148
add_executable(
147149
${NAME}
148150
EXCLUDE_FROM_ALL
149-
${CMAKE_SOURCE_DIR}/src/components/test_main.cc
150151
${SOURCES}
151152
)
152153
# TODO: Fix problems with Cotire on Windows and Qt APPLINK-28060

0 commit comments

Comments
 (0)