Skip to content

Commit 7a6305d

Browse files
committed
fix: some errors on test
1 parent 38b90d9 commit 7a6305d

File tree

5 files changed

+18
-13
lines changed

5 files changed

+18
-13
lines changed

cmake/modules/BaseConfig.cmake

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -216,11 +216,8 @@ endfunction()
216216
# Setup Target Function
217217
# *****************************************************************************
218218
function(setup_target TARGET_NAME)
219-
if (MSVC)
220-
set_property(TARGET ${TARGET_NAME} APPEND_STRING PROPERTY LINK_FLAGS " /time")
221-
if (BUILD_STATIC_LIBRARY)
222-
set_property(TARGET ${TARGET_NAME} PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
223-
endif(BUILD_STATIC_LIBRARY)
224-
endif(MSVC)
219+
if (MSVC AND BUILD_STATIC_LIBRARY)
220+
set_property(TARGET ${TARGET_NAME} PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
221+
endif()
225222
target_link_libraries(${TARGET_NAME} PUBLIC project_options)
226223
endfunction()

cmake/modules/CanaryLib.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
set(CANARY_TARGET_NAME ${PROJECT_NAME})
2-
if(ENABLE_TESTS)
2+
if(BUILD_TESTS)
33
set(CANARY_TARGET_NAME "${CANARY_TARGET_NAME}_lib")
44
# Define and setup CanaryLib main library target
55
add_library(${CANARY_TARGET_NAME})
@@ -51,7 +51,7 @@ configure_linking(${CANARY_TARGET_NAME})
5151
# === UNITY BUILD (compile time reducer) ===
5252
if(SPEED_UP_BUILD_UNITY)
5353
set_target_properties(${CANARY_TARGET_NAME} PROPERTIES UNITY_BUILD ON)
54-
log_option_enabled("Build unity for speed up compilation for taget ${CANARY_TARGET_NAME}")
54+
log_option_enabled("Build unity for speed up compilation for target ${CANARY_TARGET_NAME}")
5555
else()
5656
log_option_disabled("Build unity")
5757
endif()
@@ -60,7 +60,7 @@ endif()
6060
# Target include directories - to allow #include
6161
# *****************************************************************************
6262
target_include_directories(${CANARY_TARGET_NAME}
63-
PUBLIC
63+
PUBLIC
6464
${BOOST_DI_INCLUDE_DIRS}
6565
${CMAKE_SOURCE_DIR}/src
6666
${GMP_INCLUDE_DIRS}

src/CMakeLists.txt

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,20 @@ cmake_minimum_required(VERSION 3.22 FATAL_ERROR)
44
include(BaseConfig)
55
include(GNUInstallDirs)
66

7+
# If it is tests, we need link it static library
8+
if (BUILD_TESTS)
9+
# Import configurations, source definitions, and linker settings
10+
include(CanaryLib)
11+
endif()
12+
713
# Define main executable target, set it up and link to main library
814
add_executable(${PROJECT_NAME} main.cpp)
915

10-
# Import configurations, source definitions, and linker settings
11-
include(CanaryLib)
16+
# If it is not tests, we can link it directly to the executable
17+
if (NOT BUILD_TESTS)
18+
# Import configurations, source definitions, and linker settings
19+
include(CanaryLib)
20+
endif()
1221

1322
if(MSVC)
1423
# Add executable icon for Windows

src/protobuf/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ target_link_libraries(${PROJECT_NAME}
2525
)
2626
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
2727

28-
message("Diretório de construção atual: ${CMAKE_CURRENT_BINARY_DIR}")
29-
3028
if (MSVC AND BUILD_STATIC_LIBRARY)
3129
set_property(TARGET ${PROJECT_NAME} PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
3230
endif()

tests/unit/account/account_test.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* Contributors: https://github.com/opentibiabr/canary/graphs/contributors
77
* Website: https://docs.opentibiabr.com/
88
*/
9+
910
#include "pch.hpp"
1011

1112
#include <boost/ut.hpp>

0 commit comments

Comments
 (0)