vscode工程环境

master
18650180552 2020-09-30 11:43:43 +08:00
parent 92bc997726
commit a6a634714c
15 changed files with 32 additions and 18 deletions

View File

@ -2,9 +2,12 @@
"files.associations": { "files.associations": {
"*.rh": "cpp" "*.rh": "cpp"
}, },
"cmake.generator": "Unix Makefiles", "cmake.buildDirectory":"${workspaceFolder}/build",
"cmake.environment": { "cmake.mingwSearchDirs": [
"CMAKE_MAKE_PROGRAM":"make" "D:\\qt\\Tools\\mingw730_32",
"D:\\qt\\Tools\\mingw730_64"
],
"terminal.integrated.env.windows": {
}, },
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools" "C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools"
} }

View File

@ -1,8 +1,16 @@
cmake_minimum_required(VERSION 3.11) cmake_minimum_required(VERSION 3.11)
message( "current compiler " ${CMAKE_CXX_COMPILER_ID})
message("current CXX compiler is " ${CMAKE_CXX_COMPILER})
message("current X compiler is " ${CMAKE_CXX_COMPILER})
message("current make is " ${CMAKE_MAKE_PROGRAM})
enable_language(CXX)
project(generallib) project(generallib)
add_subdirectory(general) add_subdirectory(general)
SET(SRC_SDK sdk_main.c test/src/heapsort/main.c)# SET(SRC_SDK sdk_main.c test/src/heapsort/main.c)#
message("library object is " $<TARGET_OBJECTS:General>)
add_library(generallib STATIC $<TARGET_OBJECTS:General> ${SRC_SDK}) add_library(generallib STATIC $<TARGET_OBJECTS:General> ${SRC_SDK})
message("CMAKE_BINARY_DIR is " ${CMAKE_BINARY_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/libd)
link_directories(general/third/lib) link_directories(general/third/lib)
set_target_properties(generallib PROPERTIES LINKER_LANGUAGE CXX) set_target_properties(generallib PROPERTIES LINKER_LANGUAGE CXX)
target_link_libraries(generallib public target_link_libraries(generallib public
@ -25,8 +33,8 @@ IF (WIN32)
add_custom_command ( add_custom_command (
TARGET generallib POST_BUILD TARGET generallib POST_BUILD
COMMAND ar -x COMMAND ar -x
${CMAKE_CURRENT_SOURCE_DIR}/cmake-build-debug/libgenerallib.a ${CMAKE_CURRENT_SOURCE_DIR}/cmake-build-debug/libgeneral.a
COMMENT "package library ar -x ${CMAKE_CURRENT_SOURCE_DIR}/cmake-build-debug/libgenerallib.a" COMMENT "package library ar -x ${CMAKE_CURRENT_SOURCE_DIR}/libd/libgeneral.a "
) )
add_custom_command ( add_custom_command (
TARGET generallib POST_BUILD TARGET generallib POST_BUILD

View File

@ -1,4 +1,5 @@
from conans import ConanFile, CMake, tools from conans import ConanFile, CMake, tools
from conans import tools
class GenerallibConan(ConanFile): class GenerallibConan(ConanFile):
name = "generallib" name = "generallib"
@ -8,9 +9,14 @@ class GenerallibConan(ConanFile):
url = "https://gitee.com/290198252/generallib" url = "https://gitee.com/290198252/generallib"
description = "a simple cpp basic library" description = "a simple cpp basic library"
exports_sources = "general*", "test*" exports_sources = "general*", "test*"
def source(self):
git = tools.Git(folder="third_build/libevent")
git.clone("https://gitee.com/mirrors/libevent.git")
def package(self): def package(self):
self.copy(pattern ="*.h", dst="include", src="general",keep_path=True) self.copy(pattern ="*.h", dst="include", src="general",keep_path=True)
self.copy(pattern ="*.hpp", dst="include", src="general",keep_path=True) self.copy(pattern ="*.hpp", dst="include", src="general",keep_path=True)
def build(self): def build(self):
print("hellp") print("start build Dependency")

View File

@ -1,4 +1,5 @@
cmake_minimum_required(VERSION 3.11) cmake_minimum_required(VERSION 3.11)
enable_language(CXX)
project(General) project(General)
set(MINGW_PATH $ENV{MINGW_TOOLCHAIN}) set(MINGW_PATH $ENV{MINGW_TOOLCHAIN})
message("path is " ${MINGW_PATH}) message("path is " ${MINGW_PATH})

View File

@ -20,9 +20,11 @@ inline ENV_SYS CurrentEnvSys(){
return ENV_UNIX return ENV_UNIX
#endif #endif
#ifdef _WIN32 #ifdef _WIN32
return ENV_WINDOWS return ENV_WINDOWS;
#endif #endif
#if !defined(linux) && defined(_WINDOWS)&&defined(_UNIX)&&defined(_WIN32)
return ENV_NONE; return ENV_NONE;
#endif
} }
inline ENV_COMPILER CurrentEnvCompiler(){ inline ENV_COMPILER CurrentEnvCompiler(){

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -95,13 +95,7 @@ static void maxheap_filterup(int start)
if(m_heap[p] >= tmp) if(m_heap[p] >= tmp)
break; break;
else else
<<<<<<< Updated upstream
{ // 父节点小于当前节点,就调换位置,当前节点作为父节点,来源于一个抢位置的概念 { // 父节点小于当前节点,就调换位置,当前节点作为父节点,来源于一个抢位置的概念
=======
{ // 父节点小于当前节点,就调换位置,当前节点的值变成父节点的值,父节点的值变成当前节点的值,
// 并且父节点接着和父节点的父节点进行比较,如果还是比父节点的值大,再次把发当前节点的值
//
>>>>>>> Stashed changes
m_heap[c] = m_heap[p]; m_heap[c] = m_heap[p];
c = p; c = p;
p = (p - 1)/2; // 再把当前节点和上一个父节点在比较大小 p = (p - 1)/2; // 再把当前节点和上一个父节点在比较大小