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": {
"*.rh": "cpp"
},
"cmake.generator": "Unix Makefiles",
"cmake.environment": {
"CMAKE_MAKE_PROGRAM":"make"
"cmake.buildDirectory":"${workspaceFolder}/build",
"cmake.mingwSearchDirs": [
"D:\\qt\\Tools\\mingw730_32",
"D:\\qt\\Tools\\mingw730_64"
],
"terminal.integrated.env.windows": {
},
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools"
}

View File

@ -1,8 +1,16 @@
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)
add_subdirectory(general)
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})
message("CMAKE_BINARY_DIR is " ${CMAKE_BINARY_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/libd)
link_directories(general/third/lib)
set_target_properties(generallib PROPERTIES LINKER_LANGUAGE CXX)
target_link_libraries(generallib public
@ -18,24 +26,24 @@ IF (WIN32)
message("using gcc")
add_custom_command (
TARGET generallib POST_BUILD
COMMAND ar -x
${CMAKE_CURRENT_SOURCE_DIR}/libd/libevent.a
COMMENT "package library ar -x ${CMAKE_CURRENT_SOURCE_DIR}/libd/libevent.a"
COMMAND ar -x
${CMAKE_CURRENT_SOURCE_DIR}/libd/libevent.a
COMMENT "package library ar -x ${CMAKE_CURRENT_SOURCE_DIR}/libd/libevent.a "
)
add_custom_command (
TARGET generallib POST_BUILD
COMMAND ar -x
${CMAKE_CURRENT_SOURCE_DIR}/cmake-build-debug/libgenerallib.a
COMMENT "package library 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}/libd/libgeneral.a "
)
add_custom_command (
TARGET generallib POST_BUILD
COMMAND ar rc libgeneral.a *.o *.obj
COMMAND ar rc libgeneral.a *.o *.obj
COMMENT "package library ar rc *.o *.obj"
)
add_custom_command(
TARGET generallib POST_BUILD
COMMAND del *.o *.obj
COMMAND del *.o *.obj
COMMENT "remove all step library"
)
# using GCC

View File

@ -1,4 +1,5 @@
from conans import ConanFile, CMake, tools
from conans import tools
class GenerallibConan(ConanFile):
name = "generallib"
@ -8,9 +9,14 @@ class GenerallibConan(ConanFile):
url = "https://gitee.com/290198252/generallib"
description = "a simple cpp basic library"
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):
self.copy(pattern ="*.h", dst="include", src="general",keep_path=True)
self.copy(pattern ="*.hpp", dst="include", src="general",keep_path=True)
def build(self):
print("hellp")
print("start build Dependency")

View File

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

View File

@ -20,9 +20,11 @@ inline ENV_SYS CurrentEnvSys(){
return ENV_UNIX
#endif
#ifdef _WIN32
return ENV_WINDOWS
return ENV_WINDOWS;
#endif
#if !defined(linux) && defined(_WINDOWS)&&defined(_UNIX)&&defined(_WIN32)
return ENV_NONE;
#endif
}
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)
break;
else
<<<<<<< Updated upstream
{ // 父节点小于当前节点,就调换位置,当前节点作为父节点,来源于一个抢位置的概念
=======
{ // 父节点小于当前节点,就调换位置,当前节点的值变成父节点的值,父节点的值变成当前节点的值,
// 并且父节点接着和父节点的父节点进行比较,如果还是比父节点的值大,再次把发当前节点的值
//
>>>>>>> Stashed changes
m_heap[c] = m_heap[p];
c = p;
p = (p - 1)/2; // 再把当前节点和上一个父节点在比较大小