Skip to content

Commit 69b3eff

Browse files
authored
Merge pull request #110 from GordonSmith/VCPKG_II_AMD
feat: Bump versions
2 parents 6dfe196 + c6e6f1e commit 69b3eff

Some content is hidden

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

59 files changed

+945
-402
lines changed

.gitattributes

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
scripts/cpp-build.sh eol=lf
22
scripts/cpp-install-emsdk.sh eol=lf
3-
scripts/cpp-install-expat.sh eol=lf
43
scripts/cpp-install-graphviz.sh eol=lf
5-
scripts/cpp-update-emsdk.sh eol=lf
4+
scripts/cpp-install-vcpkg.sh eol=lf

.gitignore

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1+
/.nyc_output
12
.vscode/ipch
2-
build/
3-
dist/
4-
emsdk/
5-
src-expat/
6-
src-graphviz/
7-
lib-*/
8-
node_modules/
9-
types/
3+
/build
4+
/coverage
5+
/dist
6+
/emsdk*
7+
/src-expat
8+
/src-graphviz
9+
/lib-*
10+
/node_modules
11+
/types
12+
/vcpkg
1013
*.tsbuildinfo
11-
.nyc_output/
12-
coverage/
13-
.vscode/c_cpp_properties.json
14-
.vscode/settings.json
14+
/.vscode/c_cpp_properties.json
15+
/.vscode/settings.json

.vscode/launch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"name": "helloworld.html",
1717
"type": "pwa-msedge",
1818
"request": "launch",
19-
"url": "file://${workspaceRoot}/helloworld.html",
19+
"url": "http://localhost:8000/helloworld.html",
2020
"webRoot": "${workspaceRoot}"
2121
},
2222
{

CMakeLists.txt

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
CMAKE_MINIMUM_REQUIRED(VERSION 3.9.2)
2+
3+
PROJECT(cpp)
4+
5+
SET(CMAKE_INSTALL_PREFIX "..")
6+
SET(VCPKG_INCLUDE_DIR ${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include)
7+
8+
# See: https://github.com/emscripten-core/emscripten/blob/main/src/settings.js
9+
SET(EM_FLAGS
10+
"-s ASSERTIONS=0"
11+
"-s INVOKE_RUN=0"
12+
"-s ALLOW_MEMORY_GROWTH=1"
13+
"-s WASM=1"
14+
"-s MODULARIZE"
15+
"-s ENVIRONMENT=web,worker,node"
16+
"-s FILESYSTEM=0"
17+
"-s MINIMAL_RUNTIME=2"
18+
"-s MODULARIZE=1"
19+
"-s EXPORT_ES6=1"
20+
"-s IGNORE_CLOSURE_COMPILER_ERRORS=0"
21+
"-s USE_ES6_IMPORT_META=0"
22+
"--pre-js ${CMAKE_CURRENT_SOURCE_DIR}/cpp/src/pre.js"
23+
"--post-js ${CMAKE_CURRENT_SOURCE_DIR}/cpp/src/post.js"
24+
)
25+
26+
IF (CMAKE_BUILD_TYPE STREQUAL "Debug")
27+
SET(EM_FLAGS
28+
${EM_FLAGS}
29+
"-gsource-map"
30+
"--source-map-base ${CMAKE_CURRENT_SOURCE_DIR}"
31+
)
32+
ENDIF()
33+
34+
SET(EMSDK_DIR "${CMAKE_SOURCE_DIR}/emsdk")
35+
SET(EXPAT_DIR "${CMAKE_SOURCE_DIR}/src-expat/expat")
36+
SET(GRAPHVIZ_DIR "${CMAKE_SOURCE_DIR}/src-graphviz")
37+
38+
set(CMAKE_CXX_STANDARD 20)
39+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
40+
set(CMAKE_CXX_EXTENSIONS OFF)
41+
42+
ADD_SUBDIRECTORY(cpp)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,5 +374,5 @@ This has been made a manual step as the downloads are quite large and the auto-c
374374
### Clean dependencies:
375375
_It is worth noting that `npm run clean` will only clean any artifacts associated with the build, but won't clean clean any of the third party dependencies. To remove those for a "full clean", run:_
376376
```
377-
npm run clean-build-deps
377+
npm run uninstall-build-deps
378378
```

cpp/CMakeLists.txt

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,2 @@
1-
CMAKE_MINIMUM_REQUIRED(VERSION 3.9.2)
2-
3-
PROJECT(cpp)
4-
5-
SET(CMAKE_INSTALL_PREFIX "..")
6-
7-
SET(EMSDK_DIR "${CMAKE_SOURCE_DIR}/../emsdk")
8-
SET(EXPAT_DIR "${CMAKE_SOURCE_DIR}/../src-expat/expat")
9-
SET(GRAPHVIZ_DIR "${CMAKE_SOURCE_DIR}/../src-graphviz")
10-
111
ADD_SUBDIRECTORY(expat)
122
ADD_SUBDIRECTORY(graphviz)

cpp/expat/CMakeLists.txt

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1 @@
1-
set(CMAKE_CXX_STANDARD 17)
2-
3-
SET(EXPAT_LIB_DIR "${EXPAT_DIR}/lib")
4-
5-
ADD_DEFINITIONS(-DXML_POOR_ENTROPY)
6-
7-
INCLUDE_DIRECTORIES(
8-
${EXPAT_LIB_DIR}
9-
${CMAKE_CURRENT_SOURCE_DIR}
10-
)
11-
12-
ADD_LIBRARY(expat STATIC
13-
${EXPAT_LIB_DIR}/xmlparse.c
14-
${EXPAT_LIB_DIR}/xmlrole.c
15-
${EXPAT_LIB_DIR}/xmltok_impl.c
16-
${EXPAT_LIB_DIR}/xmltok_ns.c
17-
${EXPAT_LIB_DIR}/xmltok.c
18-
)
19-
201
ADD_SUBDIRECTORY(expatlib)

cpp/expat/expatlib/CMakeLists.txt

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
PROJECT(expatlib)
22

3-
SET(EM_FLAGS "-s WASM=1 -s INVOKE_RUN=0 -s ALLOW_MEMORY_GROWTH=1 -s MODULARIZE=1 -s EXPORT_NAME='${CMAKE_PROJECT_NAME}' -s EXPORTED_FUNCTIONS=\"['_malloc']\" --post-js ${CMAKE_CURRENT_BINARY_DIR}/main_glue.js")
3+
find_package(expat CONFIG REQUIRED)
4+
5+
# See: https://github.com/emscripten-core/emscripten/blob/main/src/settings.js
6+
SET(EM_FLAGS
7+
${EM_FLAGS}
8+
"-s FILESYSTEM=1"
9+
"-s EXPORT_NAME='${CMAKE_PROJECT_NAME}'"
10+
"-s EXPORTED_FUNCTIONS=\"['_malloc']\""
11+
"-s EXPORTED_RUNTIME_METHODS=\"[]\""
12+
"--post-js ${CMAKE_CURRENT_BINARY_DIR}/main_glue.js"
13+
)
14+
STRING(REPLACE ";" " " LINK_FLAGS "${EM_FLAGS}")
415

516
# Generate Glue from IDL file ---
617
ADD_CUSTOM_COMMAND(
@@ -12,32 +23,22 @@ SET_PROPERTY(SOURCE main.cpp APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_CURRENT_BINA
1223
# --- --- ---
1324

1425
INCLUDE_DIRECTORIES(
26+
${VCPKG_INCLUDE_DIR}
1527
${CMAKE_CURRENT_BINARY_DIR}
16-
${EXPAT_LIB_DIR}
1728
)
1829

1930
ADD_EXECUTABLE(expatlib
2031
main.cpp
2132
)
2233

23-
SET_TARGET_PROPERTIES(expatlib PROPERTIES LINK_FLAGS "-s ENVIRONMENT=web ${EM_FLAGS}")
34+
SET_TARGET_PROPERTIES(expatlib PROPERTIES LINK_FLAGS ${LINK_FLAGS})
2435

2536
TARGET_LINK_LIBRARIES(expatlib
26-
expat
27-
)
28-
29-
ADD_EXECUTABLE(expatlib.node
30-
main.cpp
37+
expat::expat
3138
)
3239

33-
SET_TARGET_PROPERTIES(expatlib.node PROPERTIES LINK_FLAGS "-s ENVIRONMENT=node ${EM_FLAGS}")
40+
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/expatlib.wasm DESTINATION dist COMPONENT runtime)
3441

35-
TARGET_LINK_LIBRARIES(expatlib.node
36-
expat
37-
)
38-
39-
INSTALL(FILES
40-
${CMAKE_CURRENT_BINARY_DIR}/expatlib.wasm
41-
DESTINATION dist
42-
COMPONENT runtime
43-
)
42+
IF (CMAKE_BUILD_TYPE STREQUAL "Debug")
43+
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/expatlib.wasm.map DESTINATION dist COMPONENT runtime)
44+
ENDIF ()

cpp/expat/expatlib/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
#include "../config.h"
21
#include "stack_parser.h"
32

43
#include <string>
4+
#include <expat.h>
55

66
class CExpat : public CExpatImpl<CExpat>
77
{
@@ -16,7 +16,7 @@ class CExpat : public CExpatImpl<CExpat>
1616
public:
1717
static const char *version()
1818
{
19-
return PACKAGE_VERSION;
19+
return XML_ExpatVersion();
2020
}
2121

2222
CExpat()

cpp/graphviz/CMakeLists.txt

Lines changed: 48 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
PROJECT(graphlayout)
22

3+
find_package(expat CONFIG REQUIRED)
4+
35
SET(GRAPHVIZ_LIB_DIR "${GRAPHVIZ_DIR}/lib")
46
SET(GRAPHVIZ_PLUGIN_DIR "${GRAPHVIZ_DIR}/plugin")
57
SET(GRAPHVIZ_BUILD_DIR "${GRAPHVIZ_DIR}/build")
68

79
INCLUDE_DIRECTORIES(
810
${CMAKE_CURRENT_SOURCE_DIR}
11+
${VCPKG_INCLUDE_DIR}
912
)
1013

1114
option(enable_ltdl "Support on-demand plugin loading" OFF)
@@ -18,30 +21,55 @@ option(with_smyrna "SMYRNA large graph viewer (disabled by default - experim
1821
option(with_zlib "Support raster image compression through zlib" OFF)
1922
option(use_sanitizers "enables using address and undefined behavior sanitizer" OFF)
2023
option(use_coverage "enables analyzing code coverage" OFF)
21-
option(with_cxx_api "enables building the C++ API" OFF)
24+
option(with_cxx_api "enables building the C++ API" ON)
2225
option(with_cxx_tests "enables building the C++ tests" OFF)
26+
option(use_win_pre_inst_libs "enables building using pre-installed Windows libraries" ON)
27+
28+
if(with_digcola)
29+
add_definitions(-DDIGCOLA)
30+
endif()
31+
32+
if(with_ipsepcola)
33+
add_definitions(-DIPSEPCOLA)
34+
endif()
35+
36+
if(with_ortho)
37+
add_definitions(-DORTHO)
38+
endif()
39+
40+
if(with_sfdp)
41+
add_definitions(-DSFDP)
42+
endif()
43+
44+
# ===================== Append local CMake module directory ====================
45+
list(APPEND CMAKE_MODULE_PATH "${GRAPHVIZ_DIR}/cmake")
46+
47+
# find_package(ANN)
48+
49+
# find_package(CAIRO)
2350

24-
if (with_digcola)
25-
add_definitions(-DDIGCOLA)
26-
endif (with_digcola)
51+
if(with_expat)
52+
find_package(EXPAT)
53+
endif()
2754

28-
if (with_ipsepcola)
29-
add_definitions(-DIPSEPCOLA)
30-
endif (with_ipsepcola)
55+
# find_package(GD)
3156

32-
if (with_ortho)
33-
add_definitions(-DORTHO)
34-
endif (with_ortho)
57+
if(enable_ltdl)
58+
find_package(LTDL)
59+
if(LTDL_FOUND)
60+
add_definitions(-DENABLE_LTDL)
61+
endif()
62+
endif()
3563

36-
if (with_sfdp)
37-
add_definitions(-DSFDP)
38-
endif (with_sfdp)
64+
# find_package(PANGOCAIRO)
3965

40-
if (with_smyrna)
41-
# TODO include dependency checks
42-
add_definitions(-DSMYRNA)
43-
endif (with_smyrna)
66+
if(with_zlib)
67+
find_package(ZLIB)
68+
endif()
4469

45-
ADD_SUBDIRECTORY(lib)
46-
ADD_SUBDIRECTORY(plugin)
47-
ADD_SUBDIRECTORY(graphvizlib)
70+
# if(UNIX)
71+
# find_library(MATH_LIB m)
72+
# endif()
73+
add_subdirectory(lib)
74+
add_subdirectory(plugin)
75+
add_subdirectory(graphvizlib)

0 commit comments

Comments
 (0)