diff --git a/.gitignore b/.gitignore index 603593c..8c4797f 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,6 @@ log_subdir/ coverage/ install/ libucore-* +src/version.c +.cache/ +compile_commands.json diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json new file mode 100644 index 0000000..b635f50 --- /dev/null +++ b/.vscode/c_cpp_properties.json @@ -0,0 +1,15 @@ +{ + "configurations": [ + { + "name": "Mac", + "includePath": [ + "${default}", + "${workspaceFolder}/include" + ], + "defines": [], + "compilerPath": "/usr/bin/clang", + "intelliSenseMode": "macos-clang-arm64" + } + ], + "version": 4 +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..f0ce8de --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,14 @@ +{ + "files.associations": { + "ringbuf.h": "c", + "seq.h": "c", + "stdint.h": "c", + "stdio.h": "c" + }, + "C_Cpp.default.includePath": [ + "/opt/homebrew/include/", + "$(workspaceFolder)/include/", + + + ] +} diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..7a23ef6 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,19 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "type": "cmake", + "label": "CMake: build", + "command": "build", + "targets": [ + "all" + ], + "group": { + "kind": "build", + "isDefault": true + }, + "problemMatcher": [], + "detail": "CMake template build task" + } + ] +} diff --git a/CMakeLists.txt b/CMakeLists.txt index 0dd5105..fd1977e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,9 +12,9 @@ set(libucore_VERSION ${libucore_VERSION_MAJOR}.${libucore_VERSION_MINOR}.${libuc set(CMAKE_VERBOSE_MAKEFILE ON) set(CMAKE_C_STANDARD 99) -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wundef -Wcast-qual -Wshadow -Wcast-align -pipe -Wno-unused-parameter -Werror=implicit-function-declaration -Winit-self -pthread") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wundef -Wcast-qual -Wshadow -Wcast-align -pipe -Wno-unused-parameter -Werror=implicit-function-declaration -Winit-self") add_definitions(-D_FILE_OFFSET_BITS=64) -set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -O2 -pthread") +set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -O2") set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) option(CODE_COVERAGE "build with code coverage intrumentation" OFF) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index dd3795d..2676c73 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -10,5 +10,5 @@ ${SOURCE_FILES} "${PROJECT_BINARY_DIR}/src/version.c" ) set_target_properties(ucore PROPERTIES SOVERSION 1 VERSION 1.0.0) -target_link_libraries(ucore pthread) +target_link_libraries(ucore Threads::Threads) install (TARGETS ucore DESTINATION lib) diff --git a/test/a.out b/test/a.out deleted file mode 100755 index 32656cf..0000000 Binary files a/test/a.out and /dev/null differ