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
35 changes: 35 additions & 0 deletions ports/slang/fix-get-target-property.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt
index 1234567..abcdefg 100644
--- a/external/CMakeLists.txt
+++ b/external/CMakeLists.txt
@@ -44,7 +44,8 @@ endif()

if(fmt_FOUND)
get_target_property(FMT_CFG fmt::fmt IMPORTED_CONFIGURATIONS)
- get_target_property(FMT_LIB fmt::fmt IMPORTED_LOCATION_${FMT_CFG})
+ list(GET FMT_CFG 0 FMT_CFG_FIRST)
+ get_target_property(FMT_LIB fmt::fmt IMPORTED_LOCATION_${FMT_CFG_FIRST})
get_target_property(FMT_INC fmt::fmt INTERFACE_INCLUDE_DIRECTORIES)
message(STATUS "Found system fmt library: ${FMT_LIB}")
message(STATUS "Using system fmt include: ${FMT_INC}")
@@ -76,7 +77,7 @@ if(SLANG_USE_MIMALLOC)

set(find_pkg_args "")
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.24.0")
- set(find_pkg_args "FIND_PACKAGE_ARGS" "${mimalloc_min_version}")
+ set(find_pkg_args "FIND_PACKAGE_ARGS")
endif()

set(MI_OVERRIDE
@@ -116,8 +117,9 @@ if(SLANG_USE_MIMALLOC)
endif()

get_target_property(MIMALLOC_CFG ${mimalloc_target} IMPORTED_CONFIGURATIONS)
- get_target_property(MIMALLOC_LIB ${mimalloc_target}
- IMPORTED_LOCATION_${MIMALLOC_CFG})
+ list(GET MIMALLOC_CFG 0 MIMALLOC_CFG_FIRST)
+ get_target_property(MIMALLOC_LIB ${mimalloc_target}
+ IMPORTED_LOCATION_${MIMALLOC_CFG_FIRST})
get_target_property(MIMALLOC_INC ${mimalloc_target}
INTERFACE_INCLUDE_DIRECTORIES)
message(STATUS "Found system mimalloc library: ${MIMALLOC_LIB}")
60 changes: 60 additions & 0 deletions ports/slang/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO MikePopoloski/slang
REF "v${VERSION}"
SHA512 f8402e422e8278be363d4630f264885230f11dcf969ffeafefc88c0ac5d0761dd81e7ee5d50bab1d4363d0783600bb974181db78609c021bde4406d8fcf1dbc5
HEAD_REF master
PATCHES
fix-get-target-property.patch
use-expected-lite.patch
)

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
mimalloc SLANG_USE_MIMALLOC
tools SLANG_INCLUDE_TOOLS
)

vcpkg_find_acquire_program(PYTHON3)

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
${FEATURE_OPTIONS}
"-DPython_EXECUTABLE=${PYTHON3}"
-DSLANG_INCLUDE_TESTS=OFF
-DSLANG_INCLUDE_DOCS=OFF
-DSLANG_INCLUDE_PYLIB=OFF
-DSLANG_INCLUDE_INSTALL=ON
-DSLANG_INCLUDE_COVERAGE=OFF
-DSLANG_USE_CPPTRACE=OFF
)

vcpkg_cmake_install()
vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/slang")

# Move misplaced pkgconfig files to the correct directory
if(EXISTS "${CURRENT_PACKAGES_DIR}/share/pkgconfig/sv-lang.pc")
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/lib/pkgconfig")
file(RENAME "${CURRENT_PACKAGES_DIR}/share/pkgconfig/sv-lang.pc" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/sv-lang.pc")
endif()
if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/share/pkgconfig/sv-lang.pc")
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig")
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/share/pkgconfig/sv-lang.pc" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/sv-lang.pc")
endif()

vcpkg_fixup_pkgconfig()
vcpkg_copy_pdbs()

if("tools" IN_LIST FEATURES)
vcpkg_copy_tools(TOOL_NAMES slang slang-hier slang-reflect slang-tidy AUTO_CLEAN)
endif()

file(REMOVE_RECURSE
"${CURRENT_PACKAGES_DIR}/debug/include"
"${CURRENT_PACKAGES_DIR}/debug/share"
"${CURRENT_PACKAGES_DIR}/share/pkgconfig"
)

file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
4 changes: 4 additions & 0 deletions ports/slang/usage
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
slang provides CMake targets:

find_package(slang CONFIG REQUIRED)
target_link_libraries(main PRIVATE slang::slang_slang)
41 changes: 41 additions & 0 deletions ports/slang/use-expected-lite.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt
index 1a54f7a24..bcc698bd0 100644
--- a/external/CMakeLists.txt
+++ b/external/CMakeLists.txt
@@ -217,10 +217,6 @@ if(SLANG_INCLUDE_INSTALL)
DIRECTORY ${PROJECT_SOURCE_DIR}/external/ieee1800/
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ieee1800
COMPONENT slang_Development)
- install(
- FILES ${PROJECT_SOURCE_DIR}/external/expected.hpp
- DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
- COMPONENT slang_Development)

if(NOT fmt_FOUND)
install(
diff --git a/include/slang/syntax/SyntaxTree.h b/include/slang/syntax/SyntaxTree.h
index 5a9030bc8..32d93de93 100644
--- a/include/slang/syntax/SyntaxTree.h
+++ b/include/slang/syntax/SyntaxTree.h
@@ -7,7 +7,7 @@
//------------------------------------------------------------------------------
#pragma once

-#include <expected.hpp>
+#include <nonstd/expected.hpp>
#include <memory>
#include <vector>

diff --git a/include/slang/text/SourceManager.h b/include/slang/text/SourceManager.h
index 0bbdf05bc..a06c8c5b8 100644
--- a/include/slang/text/SourceManager.h
+++ b/include/slang/text/SourceManager.h
@@ -8,7 +8,7 @@
#pragma once

#include <atomic>
-#include <expected.hpp>
+#include <nonstd/expected.hpp>
#include <filesystem>
#include <memory>
#include <mutex>
33 changes: 33 additions & 0 deletions ports/slang/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "slang",
"version": "10.0",
"description": "SystemVerilog compiler and language services",
"homepage": "https://github.com/MikePopoloski/slang",
"license": "MIT",
"supports": "!arm32 & !(windows & !x64)",
"dependencies": [
Comment thread
timkpaine marked this conversation as resolved.
"boost-unordered",
"expected-lite",
"fmt",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
],
"features": {
"mimalloc": {
"description": "Use the mimalloc allocator",
"supports": "!(windows & !static)",
"dependencies": [
"mimalloc"
]
},
"tools": {
"description": "Build the slang command-line tool"
}
}
}
4 changes: 4 additions & 0 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -9168,6 +9168,10 @@
"baseline": "3.0.0",
"port-version": 0
},
"slang": {
"baseline": "10.0",
"port-version": 0
},
"sleef": {
"baseline": "3.9.0",
"port-version": 1
Expand Down
9 changes: 9 additions & 0 deletions versions/s-/slang.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "882ab2ac3a544d40d80994db1c083afc5871222a",
"version": "10.0",
"port-version": 0
}
]
}
Loading