Skip to content

Commit 4ec6970

Browse files
Merge pull request #49 from Neko-Box-Coder/SkipDefaults
Ability to skip default platforms and profiles
2 parents 6533be2 + 8afaddd commit 4ec6970

Some content is hidden

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

55 files changed

+1024
-591
lines changed

CMakeLists.txt

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,14 @@ project(runcpp2)
88
set(CMAKE_CXX_STANDARD 11)
99

1010
option(RUNCPP2_UPDATE_DEFAULT_YAMLS "Update default yaml files" OFF)
11-
option(RUNCPP2_BUILD_TESTS "Build runcpp2 tests" OFF)
11+
12+
if (CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
13+
option(RUNCPP2_WARNINGS_AS_ERRORS "Treat warnings as errors" ON)
14+
option(RUNCPP2_BUILD_TESTS "Build runcpp2 tests" ON)
15+
else()
16+
option(RUNCPP2_WARNINGS_AS_ERRORS "Treat warnings as errors" OFF)
17+
option(RUNCPP2_BUILD_TESTS "Build runcpp2 tests" OFF)
18+
endif()
1219

1320
# =========================================================================
1421
# Retrieving Version String
@@ -158,28 +165,35 @@ target_link_libraries(runcpp2 PUBLIC ghc_filesystem ryml::ryml mpark_variant)
158165

159166
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
160167
# TODO: Try to change to /Wall
161-
set(STANDARD_COMPILE_FLAGS "/utf-8;/W1;/DGHC_WIN_DISABLE_WSTRING_STORAGE_TYPE=1")
168+
set(RUNCPP2_STANDARD_COMPILE_FLAGS "/utf-8;/W1;/DGHC_WIN_DISABLE_WSTRING_STORAGE_TYPE=1")
169+
if (RUNCPP2_WARNINGS_AS_ERRORS)
170+
list(APPEND RUNCPP2_STANDARD_COMPILE_FLAGS "/WX")
171+
endif()
172+
173+
message("RUNCPP2_STANDARD_COMPILE_FLAGS: ${RUNCPP2_STANDARD_COMPILE_FLAGS}")
162174
else()
163-
set(STANDARD_COMPILE_FLAGS "-Wall"
164-
"-Wno-return-local-addr"
165-
"-Wno-sign-compare"
166-
#"-Wno-unused-variable"
167-
#"-Wno-unused-but-set-variable"
168-
"-Wno-unused-parameter"
169-
"-Wno-switch"
170-
"-Wno-gnu-zero-variadic-macro-arguments"
171-
"-Wextra"
172-
"-pedantic"
173-
"-Werror")
175+
set(RUNCPP2_STANDARD_COMPILE_FLAGS "-Wall"
176+
"-Wno-return-local-addr"
177+
"-Wno-sign-compare"
178+
#"-Wno-unused-variable"
179+
#"-Wno-unused-but-set-variable"
180+
"-Wno-unused-parameter"
181+
"-Wno-switch"
182+
"-Wno-gnu-zero-variadic-macro-arguments"
183+
"-Wextra"
184+
"-pedantic")
185+
if (RUNCPP2_WARNINGS_AS_ERRORS)
186+
list(APPEND RUNCPP2_STANDARD_COMPILE_FLAGS "-Werror")
187+
endif()
174188
endif()
175189

176-
target_compile_options(runcpp2 PRIVATE "${STANDARD_COMPILE_FLAGS}")
190+
target_compile_options(runcpp2 PRIVATE "${RUNCPP2_STANDARD_COMPILE_FLAGS}")
177191

178192
# Define the version macro
179193
target_compile_definitions(runcpp2 PUBLIC RUNCPP2_VERSION="${RUNCPP2_PROJECT_VERSION}")
180194

181195
add_executable(runcpp2_main "${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/main.cpp")
182-
target_compile_options(runcpp2_main PRIVATE "${STANDARD_COMPILE_FLAGS}")
196+
target_compile_options(runcpp2_main PRIVATE "${RUNCPP2_STANDARD_COMPILE_FLAGS}")
183197
target_link_libraries(runcpp2_main PRIVATE runcpp2 ssLogger ghc_filesystem)
184198
set_target_properties(runcpp2_main PROPERTIES OUTPUT_NAME "runcpp2")
185199

Include/runcpp2/Data/DependencyInfo.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ namespace runcpp2
3131
std::unordered_map<PlatformName, ProfilesCommands> Build;
3232
std::unordered_map<PlatformName, FilesToCopyInfo> FilesToCopy;
3333

34-
bool ParseYAML_Node(ryml::ConstNodeRef& node);
34+
bool ParseYAML_Node(ryml::ConstNodeRef node);
3535
std::string ToString(std::string indentation) const;
3636
bool Equals(const DependencyInfo& other) const;
3737
};

Include/runcpp2/Data/DependencyLinkProperty.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ namespace runcpp2
2525
public:
2626
std::unordered_map<ProfileName, ProfileLinkProperty> ProfileProperties;
2727

28-
bool ParseYAML_Node(ryml::ConstNodeRef& node);
28+
bool ParseYAML_Node(ryml::ConstNodeRef node);
29+
bool ParseYAML_NodeWithProfile(ryml::ConstNodeRef node, ProfileName profile);
30+
bool IsYAML_NodeParsableAsDefault(ryml::ConstNodeRef node) const;
2931
std::string ToString(std::string indentation) const;
3032
bool Equals(const DependencyLinkProperty& other) const;
3133
};

Include/runcpp2/Data/DependencySource.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ namespace runcpp2
2121
ghc::filesystem::path ImportPath;
2222
std::vector<std::shared_ptr<DependencySource>> ImportedSources;
2323

24-
bool ParseYAML_Node(ryml::ConstNodeRef& node);
24+
bool ParseYAML_Node(ryml::ConstNodeRef node);
2525
std::string ToString(std::string indentation) const;
2626
bool Equals(const DependencySource& other) const;
2727
};

Include/runcpp2/Data/FileProperties.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ namespace runcpp2
1616
std::unordered_map<PlatformName, std::string> Prefix;
1717
std::unordered_map<PlatformName, std::string> Extension;
1818

19-
bool ParseYAML_Node(ryml::ConstNodeRef& node);
19+
bool ParseYAML_Node(ryml::ConstNodeRef node);
2020
std::string ToString(std::string indentation) const;
2121
bool Equals(const FileProperties& other) const;
2222
};

Include/runcpp2/Data/FilesToCopyInfo.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ namespace runcpp2
1616
{
1717
std::unordered_map<ProfileName, std::vector<std::string>> ProfileFiles;
1818

19-
bool ParseYAML_Node(const ryml::ConstNodeRef& node);
19+
bool ParseYAML_Node(ryml::ConstNodeRef node);
20+
bool ParseYAML_NodeWithProfile(ryml::ConstNodeRef node, ProfileName profile);
21+
bool IsYAML_NodeParsableAsDefault(ryml::ConstNodeRef node) const;
2022
std::string ToString(std::string indentation) const;
2123
bool Equals(const FilesToCopyInfo& other) const;
2224
};

Include/runcpp2/Data/FilesTypesInfo.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ namespace runcpp2
1818
FileProperties StaticLinkFile;
1919
FileProperties DebugSymbolFile;
2020

21-
bool ParseYAML_Node(ryml::ConstNodeRef& node);
21+
bool ParseYAML_Node(ryml::ConstNodeRef node);
2222
std::string ToString(std::string indentation) const;
2323
bool Equals(const FilesTypesInfo& other) const;
2424
};

Include/runcpp2/Data/FlagsOverrideInfo.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ namespace runcpp2
1414
std::string Remove;
1515
std::string Append;
1616

17-
bool ParseYAML_Node(ryml::ConstNodeRef& node);
17+
bool ParseYAML_Node(ryml::ConstNodeRef node);
18+
bool IsYAML_NodeParsableAsDefault(ryml::ConstNodeRef node) const;
1819
std::string ToString(std::string indentation) const;
1920
bool Equals(const FlagsOverrideInfo& other) const;
2021
};

Include/runcpp2/Data/GitSource.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ namespace runcpp2
1818
bool FullHistory = false;
1919
SubmoduleInitType CurrentSubmoduleInitType = SubmoduleInitType::SHALLOW;
2020

21-
bool ParseYAML_Node(ryml::ConstNodeRef& node);
21+
bool ParseYAML_Node(ryml::ConstNodeRef node);
2222
std::string ToString(std::string indentation) const;
2323
bool Equals(const GitSource& other) const;
2424
};

Include/runcpp2/Data/LocalSource.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ namespace runcpp2
2323
std::string Path;
2424
LocalCopyMode CopyMode = LocalCopyMode::Auto;
2525

26-
bool ParseYAML_Node(ryml::ConstNodeRef& node);
26+
bool ParseYAML_Node(ryml::ConstNodeRef node);
2727
std::string ToString(std::string indentation) const;
2828
bool Equals(const LocalSource& other) const;
2929
};
3030
}
3131
}
3232

33-
#endif
33+
#endif

0 commit comments

Comments
 (0)