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
34 changes: 12 additions & 22 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ endif()
# runcpp2
# =========================================================================

add_executable(runcpp2
add_library(runcpp2 STATIC
"${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/Data/Profile.cpp"
"${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/Data/DependencyInfo.cpp"
"${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/Data/DependencyLinkProperty.cpp"
Expand All @@ -139,18 +139,17 @@ add_executable(runcpp2
"${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/ConfigParsing.cpp"
"${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/DefaultYAMLs.c"
"${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/DependenciesHelper.cpp"
"${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/main.cpp"
"${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/ParseUtil.cpp"
"${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/PlatformUtil.cpp"
"${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/runcpp2.cpp"
"${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/StringUtil.cpp"
"${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/runcpp2.cpp"
"${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/BuildsManager.cpp"

)

target_include_directories(runcpp2 PRIVATE "${CMAKE_CURRENT_LIST_DIR}/Include")

target_link_libraries(runcpp2 PRIVATE ssLogger ghc_filesystem System2 ryml::ryml dylib CppOverride)
target_include_directories(runcpp2 PUBLIC "${CMAKE_CURRENT_LIST_DIR}/Include")
target_link_libraries(runcpp2 PRIVATE ssLogger System2 CppOverride dylib)
target_link_libraries(runcpp2 PUBLIC ghc_filesystem ryml::ryml)

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

target_compile_options(runcpp2 PRIVATE ${STANDARD_COMPILE_FLAGS})
target_compile_options(runcpp2 PRIVATE "${STANDARD_COMPILE_FLAGS}")

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

# TODO: Maybe move this to the UnitTests sub folder
# Unit Tests
add_executable(runcpp2_main "${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/main.cpp")
target_compile_options(runcpp2_main PRIVATE "${STANDARD_COMPILE_FLAGS}")
target_link_libraries(runcpp2_main PRIVATE runcpp2 ssLogger ghc_filesystem)
set_target_properties(runcpp2_main PROPERTIES OUTPUT_NAME "runcpp2")

if(RUNCPP2_BUILD_TESTS)
add_executable(BuildsManagerTest "${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/BuildsManager.cpp"
"${CMAKE_CURRENT_LIST_DIR}/Src/UnitTests/BuildsManagerTest.cpp")
# "${CMAKE_CURRENT_LIST_DIR}/Src/UnitTests/BuildsManager/MockComponents.cpp")

target_include_directories(BuildsManagerTest PRIVATE "${CMAKE_CURRENT_LIST_DIR}/Include")
target_compile_options(BuildsManagerTest PRIVATE "${STANDARD_COMPILE_FLAGS}")
target_link_libraries(BuildsManagerTest PRIVATE ghc_filesystem CppOverride ssTest ssLogger)
target_compile_definitions(BuildsManagerTest PRIVATE INTERNAL_RUNCPP2_UNIT_TESTS=1)
# set_target_properties(BuildsManagerTest PROPERTIES ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/tests"
# LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/tests"
# RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/tests")
add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Src/Tests")
endif()




9 changes: 6 additions & 3 deletions DefaultYAMLs/DefaultScriptInfo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
# NOTE: All the options here are defaulted to empty.
# You can uncomment different sections to set what you want.

# (Optional) Whether to pass the script path as the second parameter when running
PassScriptPath: false

# # (Optional) Language of the script
Language: "c++"

Expand Down Expand Up @@ -52,7 +55,7 @@ OtherFilesToBeCompiled:
Default:
# Target Profile
Default:
- "./AnotherSourceFile.cpp"
- "./AnotherSourceFile.cpp"

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

# (Optional) The list of dependencies needed by the script
Dependencies:
Expand Down
4 changes: 2 additions & 2 deletions DefaultYAMLs/DefaultUserConfig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ Profiles:
# Setup: []
# Cleanup: []
Windows:
Flags: "-Wl,-rpath,$ORIGIN"
Flags: "-Wl,-rpath,\\$ORIGIN"
Executable: "g++"
RunParts: *g++_LinkRunParts
# Setup: []
Expand All @@ -256,7 +256,7 @@ Profiles:
# Setup: []
# Cleanup: []
Windows:
Flags: "-shared -Wl,-rpath,$ORIGIN"
Flags: "-shared -Wl,-rpath,\\$ORIGIN"
Executable: "g++"
RunParts: *g++_LinkRunParts
# Setup: []
Expand Down
2 changes: 2 additions & 0 deletions Examples/test.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/* runcpp2

PassScriptPath: true

RequiredProfiles:
Windows: ["msvc"]
Unix: ["g++"]
Expand Down
2 changes: 1 addition & 1 deletion External/CppOverride
2 changes: 1 addition & 1 deletion External/ssTest
Submodule ssTest updated 1 files
+8 −8 Include/ssTest.hpp
42 changes: 0 additions & 42 deletions Include/runcpp2/Data/CompilerInfo.hpp

This file was deleted.

1 change: 1 addition & 0 deletions Include/runcpp2/Data/DependencyCommands.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ namespace runcpp2

bool ParseYAML_Node(ryml::ConstNodeRef& node);
std::string ToString(std::string indentation) const;
bool Equals(const DependencyCommands& other) const;
};
}
}
Expand Down
1 change: 1 addition & 0 deletions Include/runcpp2/Data/DependencyInfo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ namespace runcpp2

bool ParseYAML_Node(ryml::ConstNodeRef& node);
std::string ToString(std::string indentation) const;
bool Equals(const DependencyInfo& other) const;
};
}
}
Expand Down
3 changes: 2 additions & 1 deletion Include/runcpp2/Data/DependencyLinkProperty.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ namespace runcpp2

bool ParseYAML_Node(ryml::ConstNodeRef& node);
std::string ToString(std::string indentation) const;
bool Equals(const DependencyLinkProperty& other) const;
};
}
}

#endif
#endif
3 changes: 2 additions & 1 deletion Include/runcpp2/Data/DependencySource.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ namespace runcpp2

bool ParseYAML_Node(ryml::ConstNodeRef& node);
std::string ToString(std::string indentation) const;
bool Equals(const DependencySource& other) const;
};
}
}

#endif
#endif
3 changes: 2 additions & 1 deletion Include/runcpp2/Data/FileProperties.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ namespace runcpp2

bool ParseYAML_Node(ryml::ConstNodeRef& node);
std::string ToString(std::string indentation) const;
bool Equals(const FileProperties& other) const;
};

}
}

#endif
#endif
3 changes: 2 additions & 1 deletion Include/runcpp2/Data/FilesToCopyInfo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ namespace runcpp2

bool ParseYAML_Node(const ryml::ConstNodeRef& node);
std::string ToString(std::string indentation) const;
bool Equals(const FilesToCopyInfo& other) const;
};
}
}

#endif
#endif
1 change: 1 addition & 0 deletions Include/runcpp2/Data/FilesTypesInfo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ namespace runcpp2

bool ParseYAML_Node(ryml::ConstNodeRef& node);
std::string ToString(std::string indentation) const;
bool Equals(const FilesTypesInfo& other) const;
};
}
}
Expand Down
3 changes: 2 additions & 1 deletion Include/runcpp2/Data/FlagsOverrideInfo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ namespace runcpp2

bool ParseYAML_Node(ryml::ConstNodeRef& node);
std::string ToString(std::string indentation) const;
bool Equals(const FlagsOverrideInfo& other) const;
};
}
}


#endif
#endif
40 changes: 0 additions & 40 deletions Include/runcpp2/Data/LinkerInfo.hpp

This file was deleted.

3 changes: 1 addition & 2 deletions Include/runcpp2/Data/Profile.hpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#ifndef RUNCPP2_DATA_PROFILE_HPP
#define RUNCPP2_DATA_PROFILE_HPP

#include "runcpp2/Data/CompilerInfo.hpp"
#include "runcpp2/Data/LinkerInfo.hpp"
#include "runcpp2/Data/ParseCommon.hpp"
#include "runcpp2/Data/FilesTypesInfo.hpp"
#include "runcpp2/Data/StageInfo.hpp"
Expand Down Expand Up @@ -36,6 +34,7 @@ namespace runcpp2
void GetNames(std::vector<std::string>& outNames) const;
bool ParseYAML_Node(ryml::ConstNodeRef& profileNode);
std::string ToString(std::string indentation) const;
bool Equals(const Profile& other) const;
};
}
}
Expand Down
1 change: 1 addition & 0 deletions Include/runcpp2/Data/ProfilesCompilesFiles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ namespace runcpp2

bool ParseYAML_Node(ryml::ConstNodeRef& node);
std::string ToString(std::string indentation) const;
bool Equals(const ProfilesCompilesFiles& other) const;
};
}
}
Expand Down
1 change: 1 addition & 0 deletions Include/runcpp2/Data/ProfilesDefines.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ namespace runcpp2

bool ParseYAML_Node(ryml::ConstNodeRef& node);
std::string ToString(std::string indentation) const;
bool Equals(const ProfilesDefines& other) const;
};
}
}
Expand Down
3 changes: 2 additions & 1 deletion Include/runcpp2/Data/ProfilesFlagsOverride.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ namespace runcpp2

bool ParseYAML_Node(ryml::ConstNodeRef& node);
std::string ToString(std::string indentation) const;
bool Equals(const ProfilesFlagsOverride& other) const;
};
}
}

#endif
#endif
2 changes: 2 additions & 0 deletions Include/runcpp2/Data/ScriptInfo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ namespace runcpp2
{
public:
std::string Language;
bool PassScriptPath = false;
std::unordered_map<PlatformName, std::vector<ProfileName>> RequiredProfiles;

std::unordered_map<PlatformName, ProfilesFlagsOverride> OverrideCompileFlags;
Expand All @@ -34,6 +35,7 @@ namespace runcpp2

bool ParseYAML_Node(ryml::ConstNodeRef& node);
std::string ToString(std::string indentation) const;
bool Equals(const ScriptInfo& other) const;
};
}
}
Expand Down
4 changes: 3 additions & 1 deletion Include/runcpp2/Data/StageInfo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ namespace runcpp2
std::string& outCommand) const;

bool ParseYAML_Node(ryml::ConstNodeRef& node, std::string outputTypeKeyName);
std::string ToString(std::string indentation) const;
std::string ToString( std::string indentation,
std::string outputTypeKeyName) const;
bool Equals(const StageInfo& other) const;
};
}
}
Expand Down
3 changes: 2 additions & 1 deletion Include/runcpp2/DependenciesHelper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ namespace runcpp2
bool CleanupDependencies( const runcpp2::Data::Profile& profile,
const Data::ScriptInfo& scriptInfo,
const std::vector<Data::DependencyInfo*>& availableDependencies,
const std::vector<std::string>& dependenciesLocalCopiesPaths);
const std::vector<std::string>& dependenciesLocalCopiesPaths,
const std::string& dependenciesToReset);

bool SetupDependenciesIfNeeded( const runcpp2::Data::Profile& profile,
const ghc::filesystem::path& buildDir,
Expand Down
1 change: 1 addition & 0 deletions Include/runcpp2/ParseUtil.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ namespace runcpp2

std::string GetValue(ryml::ConstNodeRef node);
std::string GetKey(ryml::ConstNodeRef node);
std::string GetEscapedYAMLString(const std::string& input);
}

#endif
Loading