Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump lib dependencies #617

Merged
merged 13 commits into from
Sep 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
core/lib/** linguist-vendored
core/lib/** linguist-vendored -diff
engine/lib/** linguist-vendored -diff
1 change: 1 addition & 0 deletions .github/workflows/build-engine-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
- name: Install dependencies
run: |
brew install glfw llvm@14 ccache
python -m pip install jinja2

- name: Get timestamp
shell: bash
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build-engine-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
- name: Install dependencies
run: |
choco install ccache --version ${{ env.CCACHE_VERSION }}
python -m pip install jinja2

- name: Get timestamp
shell: bash
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/clang-tidy-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,14 @@ jobs:
CC: gcc-11
CXX: g++-11

- name: Build glad
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target glad

- name: Analyze
run: |
run-clang-tidy -j$(nproc) -p=build \
-header-filter="(core|engine)/(src|include)/.*" \
files "($(git diff -U0 --name-only HEAD^ | paste -s -d\|))" \
files "($(git diff -U0 --name-only HEAD^ | grep -vP '.*/lib/.*' | paste -s -d\|))" \
-export-fixes clang-tidy-fixes.yaml || true

- name: Run clang-tidy-pr-comments action
Expand Down
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,9 @@
[submodule "engine/lib/imgui"]
path = engine/lib/imgui
url = https://github.com/ocornut/imgui.git
[submodule "core/lib/json"]
path = core/lib/json
url = https://github.com/nlohmann/json.git
[submodule "core/lib/glad"]
path = core/lib/glad
url = [email protected]:Dav1dde/glad.git
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ project(cubos VERSION 0.1.0)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")

set(CMAKE_CXX_STANDARD 20)

# Should clang-tidy errors be automatically fixed?
option(FIX_CLANG_TIDY_ERRORS "Automatically fix clang-tidy errors" OFF)

Expand Down Expand Up @@ -56,8 +58,6 @@ endif()

# Function which configures a target with the options common to all CUBOS. targets.
function(cubos_common_target_options target)
target_compile_features(${target} PRIVATE cxx_std_20)

# Enable all warnings and treat them as errors
target_compile_options(${target} PRIVATE
$<$<CXX_COMPILER_ID:MSVC>:
Expand All @@ -67,6 +67,7 @@ function(cubos_common_target_options target)
/wd4996 # Disable warning about deprecated functions
/wd4458 # Disable warning about shadowing member variables
/wd4456 # Disable warning about shadowing local variables
/wd4335 # Disable warning about Mac file format
/wd5030> # Introduces false positives for [[cubos::component]]

$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:
Expand Down
11 changes: 7 additions & 4 deletions core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ cubos_common_target_options(cubos-core)
# Link dependencies

if (WITH_OPENGL)
add_subdirectory(lib/glad)
set(GLAD_SOUURCES_DIR "lib/glad")
add_subdirectory("${GLAD_SOUURCES_DIR}/cmake" glad_cmake SYSTEM)
glad_add_library(glad REPRODUCIBLE API gl:core=3.3)
target_link_libraries(cubos-core PRIVATE glad)
target_compile_definitions(cubos-core PRIVATE WITH_OPENGL)
endif ()
Expand Down Expand Up @@ -123,7 +125,7 @@ if (WITH_OPENAL)
endif()

if (GLM_USE_SUBMODULE)
add_subdirectory(lib/glm)
add_subdirectory(lib/glm SYSTEM)
else ()
find_package(glm REQUIRED)
endif ()
Expand All @@ -147,6 +149,7 @@ else ()
find_package(spdlog REQUIRED)
endif ()

set(JSON_BuildTests OFF CACHE INTERNAL "")
add_subdirectory(lib/json)

add_subdirectory(lib/stduuid)
Expand All @@ -156,8 +159,8 @@ set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)

target_compile_definitions(cubos-core PUBLIC GLM_FORCE_SILENT_WARNINGS) # Needed for compilation to succeed on MSVC
target_link_libraries(cubos-core PUBLIC glm::glm spdlog fmt::fmt json ${CMAKE_DL_LIBS})
target_link_libraries(cubos-core PRIVATE glad Threads::Threads)
target_link_libraries(cubos-core PUBLIC glm::glm spdlog nlohmann_json::nlohmann_json fmt::fmt ${CMAKE_DL_LIBS})
target_link_libraries(cubos-core PRIVATE Threads::Threads)

# Add core tests

Expand Down
1 change: 1 addition & 0 deletions core/lib/glad
Submodule glad added at d08b1a
2 changes: 0 additions & 2 deletions core/lib/glad/CMakeLists.txt

This file was deleted.

Loading
Loading