Skip to content

Commit ed8e8a3

Browse files
committed
build(cmake): fix msvc error
1 parent ab31048 commit ed8e8a3

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

tests/CMakeLists.txt

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,23 +64,24 @@ FetchContent_Declare(
6464
)
6565
if(MSVC)
6666
# target_compile_options(ut INTERFACE "/interface" "/translateInclude" "/ifcOnly")
67+
message(STATUS "disable module for msvc")
6768
set(BOOST_UT_DISABLE_MODULE ON)
68-
else()
69-
find_program(CLANG_TIDY "clang-tidy")
70-
if(CLANG_TIDY)
71-
message(STATUS "found clang-tidy: ${CLANG_TIDY}")
72-
set_target_properties(${PROJECT_NAME} PROPERTIES CXX_CLANG_TIDY ${CLANG_TIDY} -p ${CMAKE_CURRENT_BINARY_DIR})
73-
else()
74-
message(STATUS "clang-tidy not found")
75-
endif()
7669
endif()
7770
FetchContent_MakeAvailable(boost-ext-ut)
7871

79-
target_link_libraries(${PROJECT_NAME}_LIB PUBLIC stdsharp)
72+
find_program(CLANG_TIDY "clang-tidy")
73+
if(CLANG_TIDY)
74+
message(STATUS "found clang-tidy: ${CLANG_TIDY}")
75+
set_target_properties(${PROJECT_NAME} PROPERTIES CXX_CLANG_TIDY ${CLANG_TIDY} -p ${CMAKE_CURRENT_BINARY_DIR})
76+
else()
77+
message(STATUS "clang-tidy not found")
78+
endif()
79+
8080
target_include_directories(
8181
${PROJECT_NAME}_LIB
8282
SYSTEM PUBLIC $<TARGET_PROPERTY:ut,INTERFACE_INCLUDE_DIRECTORIES>
8383
)
84+
target_link_libraries(${PROJECT_NAME}_LIB PUBLIC stdsharp ut)
8485

8586
# TODO enable coverage
8687
# if(${CMAKE_CXX_COMPILER_ID} MATCHES Clang)

0 commit comments

Comments
 (0)