Skip to content
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
6 changes: 5 additions & 1 deletion .github/workflows/RunTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
branches:
- 'main'
- 'develop'
- 'linux'
env:
BUILD_TYPE: Release
BUILD_DIR: Builds
Expand Down Expand Up @@ -37,7 +38,10 @@ jobs:

- name: Set up Clang
if: runner.os == 'Linux'
uses: egor-tensin/setup-clang@v1
uses: egor-tensin/setup-clang@v2.1
with:
version: 18
platform: x64

- name: Install JUCE's Linux Deps
if: runner.os == 'Linux'
Expand Down
18 changes: 16 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,31 @@
cmake_minimum_required(VERSION 3.24)

# TODO figure this out
# https://stackoverflow.com/questions/47087237/cmake-and-ninja-rebuild-unnecessary-files
option(LINUX_REBUILD_WORKAROUND "ignore system headers for detecting dirty files" OFF)
if(LINUX_REBUILD_WORKAROUND)
file(
WRITE "${CMAKE_BINARY_DIR}/GNUMakeRulesOverwrite.cmake"
"STRING(REPLACE \"-MD\" \"-MMD\" CMAKE_DEPFILE_FLAGS_C \"\${CMAKE_DEPFILE_FLAGS_C}\")\n"
"STRING(REPLACE \"-MD\" \"-MMD\" CMAKE_DEPFILE_FLAGS_CXX \"\${CMAKE_DEPFILE_FLAGS_CXX}\")\n"
)
set(CMAKE_USER_MAKE_RULES_OVERRIDE "${CMAKE_BINARY_DIR}/GNUMakeRulesOverwrite.cmake" CACHE INTERNAL "")
endif()

project(VainDirectoryModel VERSION 0.0.1)

set(CMAKE_CXX_STANDARD 20)

include(FetchContent)
FetchContent_Declare(
juce
GIT_REPOSITORY "https://github.com/juce-framework/JUCE.git"
GIT_TAG "8.0.10"
GIT_TAG "8.0.12"
SOURCE_DIR "${CMAKE_BINARY_DIR}/juce"
BINARY_DIR "${CMAKE_BINARY_DIR}/juce_build"
)
FetchContent_MakeAvailable(juce)

add_subdirectory(Modules)
add_subdirectory(Demo)
add_subdirectory(Tests)
add_subdirectory(Demo)
2 changes: 2 additions & 0 deletions Demo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ target_compile_definitions(
Demo
PUBLIC
-DPROJECT_ROOT_DIR="${CMAKE_SOURCE_DIR}/"
-DJUCE_USE_CURL=0
-DJUCE_WEB_BROWSER=0
)

target_sources(
Expand Down
5 changes: 3 additions & 2 deletions Modules/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,19 @@ option(BUILD_SHARED_LIBS "Build efsw as a shared library" OFF)
FetchContent_Declare(
efsw
GIT_REPOSITORY "https://github.com/SpartanJ/efsw.git"
GIT_TAG "f94a661"
GIT_TAG "f94a661" # TODO update?
SOURCE_DIR "${CMAKE_BINARY_DIR}/efsw"
BINARY_DIR "${CMAKE_BINARY_DIR}/efsw_build"
)
FetchContent_MakeAvailable(efsw)

juce_add_modules(
ALIAS_NAMESPACE vdm

vdm
vdm_directory
vdm_ui
)
)

target_link_libraries(
vdm
Expand Down
1 change: 0 additions & 1 deletion Modules/vdm_directory/DirectoryModel/vdm_DirectoryModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
//-----------------------------------------------------------------------------

#include <vdm/vdm.h>
#include <juce_core/juce_core.h>
#include <juce_data_structures/juce_data_structures.h>
#include "vdm_DirectoryTree.h"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
#include "vdm_DirectoryModelSync.h"
#include "vdm_DirectoryModel.h"
#include <ranges>

//-----------------------------------------------------------------------------

vdm::DirectoryModelSync::DirectoryModelSync() = default;
//-----------------------------------------------------------------------------

vdm::DirectoryModelSync::~DirectoryModelSync() = default;
vdm::DirectoryModelSync::~DirectoryModelSync()
{
for (const auto &[id, _] : m_models)
m_fileWatcher.removeWatch(id);
}

//-----------------------------------------------------------------------------

Expand Down
3 changes: 2 additions & 1 deletion Tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ set(TestSourceFiles
)

add_executable("Tests" "${TestSourceFiles}")
target_compile_features("Tests" PRIVATE cxx_std_20)

target_compile_definitions(
"Tests"
PRIVATE
-DTEST_TEMP_DIR="${CMAKE_CURRENT_SOURCE_DIR}/tmp/"
JUCE_USE_CURL=0
-DJUCE_WEB_BROWSER=0
)

target_link_libraries("Tests"
Expand All @@ -35,6 +35,7 @@ target_link_libraries("Tests"

juce::juce_core
juce::juce_gui_basics
juce::juce_data_structures
juce::juce_recommended_config_flags
juce::juce_recommended_lto_flags
juce::juce_recommended_warning_flags
Expand Down
5 changes: 4 additions & 1 deletion Tests/DirectoryModelTests.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ TEST(DirectoryModel, AddToTree)
dir.createFile("test3.txt");

DirTestHelper dir2 = dir.createDir("asdf");

mm.runMessageThread();

dir2.createFile("dir_test1.txt");
dir2.createFile("dir_test2.txt");

Expand Down Expand Up @@ -253,7 +256,7 @@ TEST(DirectoryModel, OnModifyUpdateHandler)
vdm::DirectoryModel model;

MockModifyHandler mock;
EXPECT_CALL(mock, onModify(_, _)).Times(1);
EXPECT_CALL(mock, onModify(_, _)).Times(testing::AnyNumber());
model.addUpdateHandler(mock);

model.initialize(dir.file());
Expand Down
Loading