-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
91 additions
and
445 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
cmake_minimum_required(VERSION 3.15) | ||
|
||
project(clibs) | ||
|
||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) | ||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) | ||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) | ||
|
||
if(CMAKE_BUILD_TYPE STREQUAL Debug) | ||
set(SANITIZERS -fsanitize=address,undefined) | ||
add_link_options(${SANITIZERS}) | ||
add_compile_options(${SANITIZERS}) | ||
message(STATUS "Enabled sanitizers with: ${SANITIZERS}") | ||
endif() | ||
|
||
# --- Adding libraries --- | ||
|
||
add_subdirectory(bstr) | ||
add_subdirectory(vec) | ||
add_subdirectory(flag) | ||
|
||
target_link_libraries(flag PRIVATE bstr vec) | ||
|
||
# --- Executables --- | ||
|
||
add_executable(bstr_test bstr/maintest.c) | ||
target_link_libraries(bstr_test bstr) | ||
|
||
add_executable(vec_test vec/maintest.c) | ||
target_link_libraries(vec_test vec) | ||
|
||
add_executable(flag_test flag/maintest.c) | ||
target_link_libraries(flag_test flag) | ||
|
||
# --- Testing --- | ||
|
||
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) | ||
include(CTest) | ||
|
||
add_test(NAME bstr COMMAND bstr_test) | ||
add_test(NAME vec COMMAND vec_test) | ||
add_test(NAME flag COMMAND flag_test) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
cmake_minimum_required(VERSION 3.15) | ||
|
||
project(bstr DESCRIPTION "high level string library") | ||
|
||
add_library(bstr STATIC bstr.c) | ||
target_compile_features(bstr PUBLIC c_std_11) | ||
|
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
cmake_minimum_required(VERSION 3.10) | ||
|
||
project(flag DESCRIPTION "flag parsing library") | ||
|
||
add_library(flag flag.c) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
cmake_minimum_required(VERSION 3.10) | ||
|
||
project(vec DESCRIPTION "dynamically growable vector structure") | ||
|
||
add_library(vec STATIC vector.c) | ||
target_link_libraries(vec PRIVATE m) |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.