Skip to content

Commit fd2fcb1

Browse files
Merge pull request #27 from Neko-Box-Coder/BetterCache
Better cache
2 parents 11e082a + 0f26857 commit fd2fcb1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+2558
-686
lines changed

CMakeLists.txt

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ endif()
119119
# runcpp2
120120
# =========================================================================
121121

122-
add_executable(runcpp2
122+
add_library(runcpp2 STATIC
123123
"${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/Data/Profile.cpp"
124124
"${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/Data/DependencyInfo.cpp"
125125
"${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/Data/DependencyLinkProperty.cpp"
@@ -139,18 +139,17 @@ add_executable(runcpp2
139139
"${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/ConfigParsing.cpp"
140140
"${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/DefaultYAMLs.c"
141141
"${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/DependenciesHelper.cpp"
142-
"${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/main.cpp"
143142
"${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/ParseUtil.cpp"
144143
"${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/PlatformUtil.cpp"
145-
"${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/runcpp2.cpp"
146144
"${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/StringUtil.cpp"
145+
"${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/runcpp2.cpp"
147146
"${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/BuildsManager.cpp"
148147

149148
)
150149

151-
target_include_directories(runcpp2 PRIVATE "${CMAKE_CURRENT_LIST_DIR}/Include")
152-
153-
target_link_libraries(runcpp2 PRIVATE ssLogger ghc_filesystem System2 ryml::ryml dylib CppOverride)
150+
target_include_directories(runcpp2 PUBLIC "${CMAKE_CURRENT_LIST_DIR}/Include")
151+
target_link_libraries(runcpp2 PRIVATE ssLogger System2 CppOverride dylib)
152+
target_link_libraries(runcpp2 PUBLIC ghc_filesystem ryml::ryml)
154153

155154
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
156155
set(STANDARD_COMPILE_FLAGS "/utf-8;/W1;/DGHC_WIN_DISABLE_WSTRING_STORAGE_TYPE=1")
@@ -168,27 +167,18 @@ else()
168167
"-Werror")
169168
endif()
170169

171-
target_compile_options(runcpp2 PRIVATE ${STANDARD_COMPILE_FLAGS})
170+
target_compile_options(runcpp2 PRIVATE "${STANDARD_COMPILE_FLAGS}")
172171

173172
# Define the version macro
174173
target_compile_definitions(runcpp2 PUBLIC RUNCPP2_VERSION="${RUNCPP2_PROJECT_VERSION}")
175174

176-
# TODO: Maybe move this to the UnitTests sub folder
177-
# Unit Tests
175+
add_executable(runcpp2_main "${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/main.cpp")
176+
target_compile_options(runcpp2_main PRIVATE "${STANDARD_COMPILE_FLAGS}")
177+
target_link_libraries(runcpp2_main PRIVATE runcpp2 ssLogger ghc_filesystem)
178+
set_target_properties(runcpp2_main PROPERTIES OUTPUT_NAME "runcpp2")
179+
178180
if(RUNCPP2_BUILD_TESTS)
179-
add_executable(BuildsManagerTest "${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/BuildsManager.cpp"
180-
"${CMAKE_CURRENT_LIST_DIR}/Src/UnitTests/BuildsManagerTest.cpp")
181-
# "${CMAKE_CURRENT_LIST_DIR}/Src/UnitTests/BuildsManager/MockComponents.cpp")
182-
183-
target_include_directories(BuildsManagerTest PRIVATE "${CMAKE_CURRENT_LIST_DIR}/Include")
184-
target_compile_options(BuildsManagerTest PRIVATE "${STANDARD_COMPILE_FLAGS}")
185-
target_link_libraries(BuildsManagerTest PRIVATE ghc_filesystem CppOverride ssTest ssLogger)
186-
target_compile_definitions(BuildsManagerTest PRIVATE INTERNAL_RUNCPP2_UNIT_TESTS=1)
187-
# set_target_properties(BuildsManagerTest PROPERTIES ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/tests"
188-
# LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/tests"
189-
# RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/tests")
181+
add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Src/Tests")
190182
endif()
191183

192184

193-
194-

DefaultYAMLs/DefaultScriptInfo.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
# NOTE: All the options here are defaulted to empty.
55
# You can uncomment different sections to set what you want.
66

7+
# (Optional) Whether to pass the script path as the second parameter when running
8+
PassScriptPath: false
9+
710
# # (Optional) Language of the script
811
Language: "c++"
912

@@ -52,7 +55,7 @@ OtherFilesToBeCompiled:
5255
Default:
5356
# Target Profile
5457
Default:
55-
- "./AnotherSourceFile.cpp"
58+
- "./AnotherSourceFile.cpp"
5659

5760
# (Optional) Define cross-compiler defines for each platform and profile.
5861
# Defines can be specified as just a name or as a name-value pair.
@@ -61,8 +64,8 @@ Defines:
6164
Default:
6265
# Profile name (e.g., "g++", "clang++", "msvc", or "Default" for any profile)
6366
"Default":
64-
- "EXAMPLE_DEFINE" # Define without a value
65-
- "VERSION_MAJOR=1" # Define with a value
67+
- "EXAMPLE_DEFINE" # Define without a value
68+
- "VERSION_MAJOR=1" # Define with a value
6669

6770
# (Optional) The list of dependencies needed by the script
6871
Dependencies:

DefaultYAMLs/DefaultUserConfig.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ Profiles:
236236
# Setup: []
237237
# Cleanup: []
238238
Windows:
239-
Flags: "-Wl,-rpath,$ORIGIN"
239+
Flags: "-Wl,-rpath,\\$ORIGIN"
240240
Executable: "g++"
241241
RunParts: *g++_LinkRunParts
242242
# Setup: []
@@ -256,7 +256,7 @@ Profiles:
256256
# Setup: []
257257
# Cleanup: []
258258
Windows:
259-
Flags: "-shared -Wl,-rpath,$ORIGIN"
259+
Flags: "-shared -Wl,-rpath,\\$ORIGIN"
260260
Executable: "g++"
261261
RunParts: *g++_LinkRunParts
262262
# Setup: []

Examples/test.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
/* runcpp2
22
3+
PassScriptPath: true
4+
35
RequiredProfiles:
46
Windows: ["msvc"]
57
Unix: ["g++"]

External/ssTest

File renamed without changes.

Include/runcpp2/Data/CompilerInfo.hpp

Lines changed: 0 additions & 42 deletions
This file was deleted.

Include/runcpp2/Data/DependencyCommands.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ namespace runcpp2
2020

2121
bool ParseYAML_Node(ryml::ConstNodeRef& node);
2222
std::string ToString(std::string indentation) const;
23+
bool Equals(const DependencyCommands& other) const;
2324
};
2425
}
2526
}

Include/runcpp2/Data/DependencyInfo.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ namespace runcpp2
3333

3434
bool ParseYAML_Node(ryml::ConstNodeRef& node);
3535
std::string ToString(std::string indentation) const;
36+
bool Equals(const DependencyInfo& other) const;
3637
};
3738
}
3839
}

0 commit comments

Comments
 (0)