-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37 from R3mmurd/v2.0.0
V2.0.0
- Loading branch information
Showing
153 changed files
with
17,068 additions
and
17,101 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: C/C++ CI | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build_with_clang: | ||
name: Build with Clang | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Run Cmake | ||
run: | ||
mkdir build && cd build && cmake -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang ../ | ||
- name: Build Library | ||
run: cd build && make all | ||
- name: Run tests | ||
run: cd build && make test |
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 |
---|---|---|
@@ -1,7 +1,11 @@ | ||
.vscode | ||
.vs | ||
doc | ||
doxyfile | ||
build/ | ||
*~ | ||
samples/bin/* | ||
tests/bin/* | ||
bin/* | ||
include/*~ | ||
lib/*.a | ||
|
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,72 @@ | ||
cmake_minimum_required(VERSION 3.20) | ||
project(Designar VERSION 2.0.0) | ||
|
||
# Set C++ Required version | ||
SET(CMAKE_CXX_STANDARD 17) | ||
SET(CMAKE_CXX_STANDARD_REQUIRED true) | ||
|
||
# Use -std=c++XX instead of -std=gnu++XX | ||
set(CMAKE_CXX_EXTENSIONS OFF) | ||
|
||
# Append macro directory to CMake Path | ||
list(APPEND CMAKE_MODULE_PATH | ||
"${CMAKE_SOURCE_DIR}/cmake/macros") | ||
|
||
# Import cmake options | ||
include(CTest) | ||
include(ConfigureBaseTargets) | ||
include(CheckPlatform) | ||
|
||
# Designar Library | ||
file(GLOB DESIGNAR_SOURCES "${PROJECT_SOURCE_DIR}/src/*.cpp") | ||
add_library(Designar STATIC ${DESIGNAR_SOURCES}) | ||
target_include_directories(Designar PUBLIC "${PROJECT_SOURCE_DIR}/include") | ||
target_link_libraries(Designar | ||
PUBLIC | ||
designar-warning-interface | ||
designar-compile-option-interface | ||
) | ||
install( | ||
TARGETS Designar | ||
DESTINATION ${PROJECT_SOURCE_DIR}/lib | ||
) | ||
|
||
find_package(Threads REQUIRED) | ||
|
||
# Designar Samples | ||
file(GLOB DESIGNAR_SAMPLES_SOURCES "${PROJECT_SOURCE_DIR}/samples/src/*.cpp") | ||
foreach(samplefile ${DESIGNAR_SAMPLES_SOURCES}) | ||
get_filename_component(samplename ${samplefile} NAME_WE) | ||
add_executable(${samplename} ${samplefile}) | ||
target_link_libraries(${samplename} | ||
PUBLIC | ||
Designar | ||
Threads::Threads | ||
) | ||
install( | ||
FILES ${CMAKE_CURRENT_BINARY_DIR}/${samplename} | ||
DESTINATION ${PROJECT_SOURCE_DIR}/samples/bin | ||
) | ||
endforeach(samplefile ${DESIGNAR_SAMPLES_SOURCES}) | ||
|
||
# Designar Tests | ||
file(GLOB DESIGNAR_TESTS_SOURCES "${PROJECT_SOURCE_DIR}/tests/src/*.cpp") | ||
foreach(testfile ${DESIGNAR_TESTS_SOURCES}) | ||
get_filename_component(testname ${testfile} NAME_WE) | ||
add_executable(${testname} ${testfile}) | ||
target_link_libraries(${testname} | ||
PUBLIC | ||
Designar | ||
Threads::Threads | ||
) | ||
install( | ||
FILES ${CMAKE_CURRENT_BINARY_DIR}/${testname} | ||
DESTINATION ${PROJECT_SOURCE_DIR}/tests/bin | ||
) | ||
add_test( | ||
NAME | ||
${testname} | ||
COMMAND | ||
${testname} | ||
) | ||
endforeach(testfile ${DESIGNAR_TESTS_SOURCES}) |
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,22 @@ | ||
set(CLANG_EXPECTED_VERSION 14.0.0) | ||
|
||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS CLANG_EXPECTED_VERSION) | ||
message(FATAL_ERROR "Clang: Designar requires version ${CLANG_EXPECTED_VERSION} to build but found ${CMAKE_CXX_COMPILER_VERSION}") | ||
else() | ||
message(STATUS "Clang: Minimum version required is ${CLANG_EXPECTED_VERSION}, found ${CMAKE_CXX_COMPILER_VERSION} - ok!") | ||
endif() | ||
|
||
# Clang Warning Options | ||
target_compile_options(designar-warning-interface | ||
INTERFACE | ||
-Wall | ||
-Wextra | ||
-Wcast-align | ||
-Wno-sign-compare | ||
-Wno-write-strings | ||
-Wno-parentheses | ||
-Wfloat-equal | ||
-pedantic | ||
) | ||
|
||
message(STATUS "Clang: All warnings enabled") |
Empty file.
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,10 @@ | ||
|
||
# Warning interface in Visual Studio | ||
target_compile_options(designar-warning-interface | ||
INTERFACE | ||
/W3) | ||
|
||
# disable permissive mode to make msvc more eager to reject code that other compilers don't already accept | ||
target_compile_options(designar-compile-option-interface | ||
INTERFACE | ||
/permissive-) |
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,14 @@ | ||
# check what platform we're on (64-bit or 32-bit), and create a simpler test than CMAKE_SIZEOF_VOID_P | ||
if(CMAKE_SIZEOF_VOID_P MATCHES 8) | ||
set(PLATFORM 64) | ||
MESSAGE(STATUS "Detected 64-bit platform") | ||
else() | ||
set(PLATFORM 32) | ||
MESSAGE(STATUS "Detected 32-bit platform") | ||
endif() | ||
|
||
if(WIN32) | ||
include("${CMAKE_SOURCE_DIR}/cmake/platform/windows/settings.cmake") | ||
elseif(UNIX) | ||
include("${CMAKE_SOURCE_DIR}/cmake/platform/unix/settings.cmake") | ||
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,6 @@ | ||
# An interface library to make the warnings level available to other targets | ||
# This interface taget is set-up through the platform specific script | ||
add_library(designar-warning-interface INTERFACE) | ||
|
||
# An interface library to make the target com available to other targets | ||
add_library(designar-compile-option-interface INTERFACE) |
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 @@ | ||
message(STATUS "UNIX: Detected compiler: ${CMAKE_C_COMPILER}") | ||
if(CMAKE_C_COMPILER MATCHES "gcc" OR CMAKE_C_COMPILER_ID STREQUAL "GNU") | ||
include(${CMAKE_SOURCE_DIR}/cmake/compiler/gcc/settings.cmake) | ||
elseif(CMAKE_C_COMPILER MATCHES "clang" OR CMAKE_C_COMPILER_ID MATCHES "Clang") | ||
include(${CMAKE_SOURCE_DIR}/cmake/compiler/clang/settings.cmake) | ||
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,3 @@ | ||
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" OR CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC") | ||
include(${CMAKE_SOURCE_DIR}/cmake/compiler/msvc/settings.cmake) | ||
endif() |
Oops, something went wrong.