Skip to content

Commit 640f454

Browse files
Including libyaml as part of unity build
1 parent 21b0f06 commit 640f454

File tree

12 files changed

+35
-21
lines changed

12 files changed

+35
-21
lines changed

CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,9 @@ set(DS_USE_DEBUG_BREAK ON)
112112
add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/External/DSResult")
113113

114114
set(BUILD_TESTING ON)
115-
add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/External/libyaml")
115+
# add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/External/libyaml")
116+
add_library(libyaml INTERFACE)
117+
target_include_directories(libyaml INTERFACE "${CMAKE_CURRENT_LIST_DIR}/External/libyaml/include")
116118
set(BUILD_TESTING OFF)
117119

118120
# NOTE: Just include the file. Can't add subdirectory since it install stuff
@@ -183,7 +185,7 @@ set(RUNCPP2_SOURCE_FILES "${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/runcpp2.cpp")
183185
add_library(runcpp2Lib INTERFACE)
184186

185187
set(RUNCPP2_PRIVATE_LINK_LIBS ssLogger System2 CppOverride dylib)
186-
set(RUNCPP2_PUBLIC_LINK_LIBS ghc_filesystem mpark_variant MacroPowerToys string-view-lite yaml DSResult)
188+
set(RUNCPP2_PUBLIC_LINK_LIBS ghc_filesystem mpark_variant MacroPowerToys string-view-lite libyaml DSResult)
187189
target_include_directories(runcpp2Lib INTERFACE "${CMAKE_CURRENT_LIST_DIR}/Include"
188190
"${CMAKE_CURRENT_LIST_DIR}/Src")
189191
target_link_libraries(runcpp2Lib INTERFACE ${RUNCPP2_PRIVATE_LINK_LIBS})

Include/runcpp2/Data/ScriptInfo.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#include "runcpp2/ParseUtil.hpp"
1111
#include "runcpp2/Data/ParseCommon.hpp"
1212
#include "runcpp2/LibYAML_Wrapper.hpp"
13-
#include "runcpp2/YamlLib.hpp"
1413

1514
#undef RUNCPP2_CURRENT_CLASS_NAME
1615
#define RUNCPP2_CURRENT_CLASS_NAME ScriptInfo

Include/runcpp2/YamlLib.hpp

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

Include/runcpp2/runcpp2.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
#include <system_error>
3131
#include <unordered_map>
3232

33+
//NOTE: #include "runcpp2/LibYamlImpl.cpp" at the end
34+
3335
//Use for SetDllDirectory
3436
#if defined(_WIN32)
3537
#ifndef WIN32_LEAN_AND_MEAN
@@ -910,4 +912,6 @@ namespace runcpp2
910912
}
911913
}
912914

915+
#include "runcpp2/LibYamlImpl.cpp"
916+
913917
#endif

Src/Tests/ConfigParsingTest.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
#include "ssLogger/ssLog.hpp"
55
#include "MacroPowerToys.h"
66

7+
//NOTE: #include "runcpp2/DefaultYAMLs.c" at the end
8+
//NOTE: #include "runcpp2/LibYamlImpl.cpp" at the end
9+
710
CO_DECLARE_INSTANCE(OverrideInstance);
811

912
#define INTERNAL_RUNCPP2_UNDEF_MOCKS 1
@@ -607,3 +610,4 @@ int main(int argc, char** argv)
607610
}
608611

609612
#include "runcpp2/DefaultYAMLs.c"
613+
#include "runcpp2/LibYamlImpl.cpp"

Src/Tests/Data/DependencyInfoTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#include "runcpp2/Data/DependencyInfo.hpp"
2-
#include "runcpp2/YamlLib.hpp"
2+
#include "runcpp2/LibYAML_Wrapper.hpp"
33
#include "runcpp2/runcpp2.hpp"
44
#include "runcpp2/DeferUtil.hpp"
55
#include "ssLogger/ssLog.hpp"

Src/Tests/Data/DependencySourceTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#include "runcpp2/Data/DependencySource.hpp"
2-
#include "runcpp2/YamlLib.hpp"
2+
#include "runcpp2/LibYAML_Wrapper.hpp"
33
#include "runcpp2/runcpp2.hpp"
44
#include "runcpp2/DeferUtil.hpp"
55
#include "ssLogger/ssLog.hpp"

Src/Tests/Data/ProfileTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "runcpp2/Data/Profile.hpp"
22
#include "runcpp2/runcpp2.hpp"
3-
#include "runcpp2/YamlLib.hpp"
3+
#include "runcpp2/LibYAML_Wrapper.hpp"
44
#include "runcpp2/DeferUtil.hpp"
55
#include "ssLogger/ssLog.hpp"
66

Src/Tests/Data/ScriptInfoTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#include "runcpp2/Data/ScriptInfo.hpp"
2-
#include "runcpp2/YamlLib.hpp"
2+
#include "runcpp2/LibYAML_Wrapper.hpp"
33
#include "runcpp2/runcpp2.hpp"
44
#include "runcpp2/DeferUtil.hpp"
55
#include "ssLogger/ssLog.hpp"

Src/runcpp2/LibYamlImpl.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//libyaml implementations
2+
extern "C" {
3+
#define YAML_STR(x) #x
4+
#define YAML_VERSION_MAJOR 0
5+
#define YAML_VERSION_MINOR 2
6+
#define YAML_VERSION_PATCH 5
7+
#define YAML_VERSION_STRING YAML_STR(YAML_VERSION_MAJOR) "." YAML_STR(YAML_VERSION_MINOR) "." YAML_STR(YAML_VERSION_PATCH)
8+
9+
#include "../src/api.c"
10+
#include "../src/dumper.c"
11+
#include "../src/emitter.c"
12+
#include "../src/loader.c"
13+
#include "../src/parser.c"
14+
#include "../src/reader.c"
15+
#include "../src/scanner.c"
16+
#include "../src/writer.c"
17+
}

0 commit comments

Comments
 (0)