Skip to content

Commit 0e64106

Browse files
Updating examples to be able to run on Windows
1 parent be6b813 commit 0e64106

File tree

7 files changed

+27
-11
lines changed

7 files changed

+27
-11
lines changed

Examples/CivetwebStaticWebServer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
DefaultProfile:
1919
SearchLibraryNames: ["civetweb"]
2020
SearchDirectories: ["./output/src"]
21-
Setup: ["mkdir output", "cd output && cmake .."]
21+
Setup: ["mkdir output", "cd output && cmake .. -DCIVETWEB_BUILD_TESTING=OFF -DCIVETWEB_ENABLE_ASAN=OFF"]
2222
Build: ["cd output && cmake --build . -j 16"]
2323
*/
2424

Examples/CppStaticWebServer.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
URL: "https://github.com/yhirose/cpp-httplib.git"
99
Branch: "v0.20.0"
1010
LibraryType: Header
11-
IncludePaths:
12-
- "./"
11+
IncludePaths: ["./"]
1312
*/
1413

1514
#include "httplib.h"

Examples/MatplotExample.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
/* runcpp2
22
3+
OverrideCompileFlags:
4+
Windows:
5+
msvc:
6+
Append: "/wd4251"
7+
Defines: ["MATPLOT_BUILD_HIGH_RESOLUTION_WORLD_MAP"]
38
Dependencies:
49
- Name: matplotplusplus
510
Platforms: [DefaultPlatform]
@@ -17,12 +22,13 @@
1722
SearchDirectories: ["./build/source/matplot"]
1823
Windows:
1924
DefaultProfile:
20-
SearchLibraryNames: ["libmatplot"]
25+
SearchLibraryNames: ["matplot"]
2126
SearchDirectories: ["./build/source/matplot/debug"]
2227
Setup:
2328
- "mkdir build"
2429
- "cd build && cmake .. -DMATPLOTPP_BUILD_WITH_SANITIZERS=OFF -DMATPLOTPP_BUILD_EXAMPLES=OFF -DMATPLOTPP_BUILD_INSTALLER=OFF -DMATPLOTPP_BUILD_PACKAGE=OFF -DBUILD_SHARED_LIBS=ON"
25-
- "cd build && cmake --build . -j 16"*/
30+
- "cd build && cmake --build . -j 16"
31+
*/
2632

2733
#include "matplot/matplot.h"
2834

@@ -33,9 +39,9 @@ int main()
3339
{
3440
//NOTE: Alternatively, you can put this under "Setup" section in runcpp2 build settings
3541
#ifdef _WIN32
36-
if(system("which gnuplot") != 0)
37-
#else
3842
if(system("where gnuplot") != 0)
43+
#else
44+
if(system("which gnuplot") != 0)
3945
#endif
4046
{
4147
std::cout << "Failed to find gnuplot, please install it on the system" << std::endl;
@@ -45,7 +51,6 @@ int main()
4551
auto f1 = matplot::figure();
4652
matplot::plot(matplot::vector_1d{1., 2., 3.}, matplot::vector_1d{2., 4., 6.});
4753

48-
4954
auto f2 = matplot::figure();
5055
matplot::scatter(matplot::iota(1, 20), matplot::rand(20, 0, 1));
5156

Examples/SDLWindow.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,12 @@
1616
DefaultProfile:
1717
SearchLibraryNames: ["SDL2"]
1818
SearchDirectories: ["./build/debug"]
19+
ExcludeLibraryNames: ["SDL2-static", "SDL2_test"]
1920
Unix:
2021
DefaultProfile:
2122
SearchLibraryNames: ["SDL2"]
2223
SearchDirectories: ["./build"]
24+
ExcludeLibraryNames: ["SDL2-static", "SDL2_test"]
2325
Setup: ["mkdir build", "cd build && cmake .."]
2426
Build: ["cd build && cmake --build . -j 16"]
2527
@@ -33,7 +35,7 @@
3335
*/
3436

3537

36-
#include <SDL2/SDL.h>
38+
#include "SDL.h"
3739

3840
#include <iostream>
3941

Examples/index.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!-- From https://www.w3schools.com/html/html_basic.asp -->
2+
<!DOCTYPE html>
3+
<html>
4+
<body>
5+
6+
<h1>My First Heading</h1>
7+
<p>My first paragraph.</p>
8+
9+
</body>
10+
</html>

Tests/test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ PassScriptPath: true
8181
DefaultPlatform:
8282
DefaultProfile:
8383
- "cd build && cmake .. -DssLOG_BUILD_TYPE=SHARED"
84-
- "cd build && cmake --build . --config Release -j 16"
84+
- "cd build && cmake --build . -j 16"
8585
FilesToCopy:
8686
# Target Platform (Default, Windows, Linux, MacOS, or Unix)
8787
DefaultPlatform:

Tests/test_static.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ BuildType: Static
8181
DefaultPlatform:
8282
DefaultProfile:
8383
- "cd build && cmake .. -DssLOG_BUILD_TYPE=SHARED"
84-
- "cd build && cmake --build . --config Release -j 16"
84+
- "cd build && cmake --build . -j 16"
8585
FilesToCopy:
8686
# Target Platform (Default, Windows, Linux, MacOS, or Unix)
8787
DefaultPlatform:

0 commit comments

Comments
 (0)