build: MSVC with multicore compilation and actual tree directory display (#2900)

This commit is contained in:
XMuli
2022-10-04 01:27:44 +08:00
committed by GitHub
parent 5f67ab50fb
commit 11670457f3

View File

@@ -76,6 +76,16 @@ if (WIN32)
endif ()
endif ()
if(MSVC)
OPTION(USE_MP "use multiple" ON)
OPTION(ProjectConfig_Global_COMPILE_FLAGS_WITH_MP
"Set The Global Option COMPILE_FLAGS /MP to target." ON)
if(ProjectConfig_Global_COMPILE_FLAGS_WITH_MP OR USE_MP)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
endif()
endif()
add_subdirectory(cli)
add_subdirectory(config)
add_subdirectory(core)
@@ -223,6 +233,15 @@ if (APPLE)
)
endif ()
set(_src_root_path ${CMAKE_CURRENT_SOURCE_DIR})
file(GLOB_RECURSE _source_list LIST_DIRECTORIES false
"${_src_root_path}/*.cpp"
"${_src_root_path}/*.h")
# will be organized according to the actual directory structure, .h.cpp is put together
source_group(TREE ${_src_root_path} FILES ${_source_list})
if (WIN32)
set(USE_OPENSSL FALSE)
if (ENABLE_OPENSSL)