Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

custom_target GENHDR generates MSB8065 warnings under windows platform #3060

Open
freemine opened this issue Feb 6, 2024 · 0 comments
Open

Comments

@freemine
Copy link

freemine commented Feb 6, 2024

C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(248,5): warning MSB8065: 项“C:\Users\xxh\Documents\taos\mytaos\.externals\build\libwebsockets\src\e
x_libwebsockets-build\lws_config.h”的自定义生成成功,但尚未创建指定的输出“c:\users\xxh\documents\taos\mytaos\.externals\build\libwebsockets\src\ex_libwebsockets-build\genhdr.done”。这可能会导致增量生成无法正常工作。 [C:\Users\xxh\Documents\taos\
mytaos\.externals\build\libwebsockets\src\ex_libwebsockets-build\GENHDR.vcxproj] [C:\Users\xxh\Documents\taos\mytaos\build\ex_libwebsockets.vcxproj]

this was recorded under:
windows 11 - chinese version
cmake: 3.28.0-rc2
Visual Studio: 2022

FYI, for warning MSB8065, relative info could be found at https://developercommunity.visualstudio.com/t/warning-msb8065-file-not-created/1413417

if this warning exists, incremental build would not be available.

currently, i locate the root cause in /CMakeLists.txt:

add_custom_command(
		OUTPUT ${PROJECT_BINARY_DIR}/include/lws_config.h
			${PROJECT_BINARY_DIR}/include/libwebsockets
			${PROJECT_BINARY_DIR}/include/libwebsockets.h
		COMMENT "Creating build include dir"
		COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/include/libwebsockets.h
     			${CMAKE_CURRENT_BINARY_DIR}/include/libwebsockets.h
		COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/include/libwebsockets/
			${CMAKE_CURRENT_BINARY_DIR}/include/libwebsockets
		COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_BINARY_DIR}/lws_config.h
     			${CMAKE_CURRENT_BINARY_DIR}/include/lws_config.h
		MAIN_DEPENDENCY ${PROJECT_BINARY_DIR}/lws_config.h
)

add_custom_target(GENHDR DEPENDS  ${PROJECT_BINARY_DIR}/include/lws_config.h)

and it would help if make changes as such:
NOTE: on libwebsockets branch: v4.3.3

add_custom_command(
		OUTPUT ${PROJECT_BINARY_DIR}/genhdr.done
		COMMENT "Creating build include dir"
		COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/include/libwebsockets.h
     			${CMAKE_CURRENT_BINARY_DIR}/include/libwebsockets.h
		COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/include/libwebsockets/
			${CMAKE_CURRENT_BINARY_DIR}/include/libwebsockets
		COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_BINARY_DIR}/lws_config.h
     			${CMAKE_CURRENT_BINARY_DIR}/include/lws_config.h
     		COMMAND ${CMAKE_COMMAND} -E touch ${PROJECT_BINARY_DIR}/genhdr.done
		MAIN_DEPENDENCY ${PROJECT_BINARY_DIR}/lws_config.h
)

add_custom_target(GENHDR DEPENDS  ${PROJECT_BINARY_DIR}/genhdr.done)
@freemine freemine changed the title custom_target GENHDR generates MSB806 warnings under windows platform custom_target GENHDR generates MSB8065 warnings under windows platform Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant