aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake')
-rw-r--r--cmake/Deps.cmake31
-rw-r--r--cmake/FindLibvterm.cmake31
-rw-r--r--cmake/FindMsgpack.cmake24
-rw-r--r--cmake/FindUTF8proc.cmake12
-rw-r--r--cmake/FindWasmtime.cmake22
5 files changed, 60 insertions, 60 deletions
diff --git a/cmake/Deps.cmake b/cmake/Deps.cmake
index 413e3a08a9..519826654f 100644
--- a/cmake/Deps.cmake
+++ b/cmake/Deps.cmake
@@ -18,11 +18,6 @@ if(APPLE)
list(APPEND DEPS_CMAKE_ARGS -D CMAKE_FIND_FRAMEWORK=${CMAKE_FIND_FRAMEWORK})
endif()
-# Can be removed once minimum version is at least 3.15
-if(POLICY CMP0092)
- list(APPEND DEPS_CMAKE_ARGS -D CMAKE_POLICY_DEFAULT_CMP0092=NEW)
-endif()
-
find_program(CACHE_PRG NAMES ccache sccache)
if(CACHE_PRG)
set(CMAKE_C_COMPILER_LAUNCHER ${CMAKE_COMMAND} -E env CCACHE_SLOPPINESS=pch_defines,time_macros ${CACHE_PRG})
@@ -58,6 +53,32 @@ if(CMAKE_OSX_SYSROOT)
set(DEPS_C_COMPILER "${DEPS_C_COMPILER} -isysroot${CMAKE_OSX_SYSROOT}")
endif()
+get_filename_component(rootdir ${PROJECT_SOURCE_DIR} NAME)
+if(${rootdir} MATCHES "cmake.deps")
+ set(depsfile ${PROJECT_SOURCE_DIR}/deps.txt)
+else()
+ set(depsfile ${PROJECT_SOURCE_DIR}/cmake.deps/deps.txt)
+endif()
+
+set_directory_properties(PROPERTIES
+ EP_PREFIX "${DEPS_BUILD_DIR}"
+ CMAKE_CONFIGURE_DEPENDS ${depsfile})
+
+file(READ ${depsfile} DEPENDENCIES)
+STRING(REGEX REPLACE "\n" ";" DEPENDENCIES "${DEPENDENCIES}")
+foreach(dep ${DEPENDENCIES})
+ STRING(REGEX REPLACE " " ";" dep "${dep}")
+ list(GET dep 0 name)
+ list(GET dep 1 value)
+ if(NOT ${name})
+ # _URL variables must NOT be set when USE_EXISTING_SRC_DIR is set,
+ # otherwise ExternalProject will try to re-download the sources.
+ if(NOT USE_EXISTING_SRC_DIR)
+ set(${name} ${value})
+ endif()
+ endif()
+endforeach()
+
function(get_externalproject_options name DEPS_IGNORE_SHA)
string(TOUPPER ${name} name_allcaps)
set(url ${${name_allcaps}_URL})
diff --git a/cmake/FindLibvterm.cmake b/cmake/FindLibvterm.cmake
deleted file mode 100644
index 68c2646d47..0000000000
--- a/cmake/FindLibvterm.cmake
+++ /dev/null
@@ -1,31 +0,0 @@
-find_path2(LIBVTERM_INCLUDE_DIR vterm.h)
-find_library2(LIBVTERM_LIBRARY vterm)
-
-if(LIBVTERM_INCLUDE_DIR AND EXISTS "${LIBVTERM_INCLUDE_DIR}/vterm.h")
- file(STRINGS ${LIBVTERM_INCLUDE_DIR}/vterm.h VTERM_VERSION_MAJOR REGEX "#define VTERM_VERSION_MAJOR")
- string(REGEX MATCH "[0-9]+" VTERM_VERSION_MAJOR ${VTERM_VERSION_MAJOR})
-
- file(STRINGS ${LIBVTERM_INCLUDE_DIR}/vterm.h VTERM_VERSION_MINOR REGEX "#define VTERM_VERSION_MINOR")
- string(REGEX MATCH "[0-9]+" VTERM_VERSION_MINOR ${VTERM_VERSION_MINOR})
-
- file(STRINGS ${LIBVTERM_INCLUDE_DIR}/vterm.h VTERM_VERSION_PATCH REGEX "#define VTERM_VERSION_PATCH")
-
- # The following is needed to give a coherent error for versions 0.3.2 and
- # smaller.
- if(VTERM_VERSION_PATCH)
- string(REGEX MATCH "[0-9]+" VTERM_VERSION_PATCH ${VTERM_VERSION_PATCH})
- string(PREPEND VTERM_VERSION_PATCH ".")
- endif()
-
- set(VTERM_VERSION ${VTERM_VERSION_MAJOR}.${VTERM_VERSION_MINOR}${VTERM_VERSION_PATCH})
-endif()
-
-find_package_handle_standard_args(Libvterm
- REQUIRED_VARS LIBVTERM_INCLUDE_DIR LIBVTERM_LIBRARY
- VERSION_VAR VTERM_VERSION)
-
-add_library(libvterm INTERFACE)
-target_include_directories(libvterm SYSTEM BEFORE INTERFACE ${LIBVTERM_INCLUDE_DIR})
-target_link_libraries(libvterm INTERFACE ${LIBVTERM_LIBRARY})
-
-mark_as_advanced(LIBVTERM_INCLUDE_DIR LIBVTERM_LIBRARY)
diff --git a/cmake/FindMsgpack.cmake b/cmake/FindMsgpack.cmake
deleted file mode 100644
index 9ef18122ab..0000000000
--- a/cmake/FindMsgpack.cmake
+++ /dev/null
@@ -1,24 +0,0 @@
-find_path2(MSGPACK_INCLUDE_DIR msgpack/version_master.h)
-
-if(MSGPACK_INCLUDE_DIR)
- file(READ ${MSGPACK_INCLUDE_DIR}/msgpack/version_master.h msgpack_version_h)
- string(REGEX REPLACE ".*MSGPACK_VERSION_MAJOR +([0-9]+).*" "\\1" MSGPACK_VERSION_MAJOR "${msgpack_version_h}")
- string(REGEX REPLACE ".*MSGPACK_VERSION_MINOR +([0-9]+).*" "\\1" MSGPACK_VERSION_MINOR "${msgpack_version_h}")
- string(REGEX REPLACE ".*MSGPACK_VERSION_REVISION +([0-9]+).*" "\\1" MSGPACK_VERSION_REVISION "${msgpack_version_h}")
- set(MSGPACK_VERSION_STRING "${MSGPACK_VERSION_MAJOR}.${MSGPACK_VERSION_MINOR}.${MSGPACK_VERSION_REVISION}")
-else()
- set(MSGPACK_VERSION_STRING)
-endif()
-
-find_library2(MSGPACK_LIBRARY NAMES msgpackc msgpack msgpackc_import msgpack-c
- NAMES_PER_DIR)
-
-mark_as_advanced(MSGPACK_INCLUDE_DIR MSGPACK_LIBRARY)
-
-find_package_handle_standard_args(Msgpack
- REQUIRED_VARS MSGPACK_LIBRARY MSGPACK_INCLUDE_DIR
- VERSION_VAR MSGPACK_VERSION_STRING)
-
-add_library(msgpack INTERFACE)
-target_include_directories(msgpack SYSTEM BEFORE INTERFACE ${MSGPACK_INCLUDE_DIR})
-target_link_libraries(msgpack INTERFACE ${MSGPACK_LIBRARY})
diff --git a/cmake/FindUTF8proc.cmake b/cmake/FindUTF8proc.cmake
new file mode 100644
index 0000000000..2183f35d34
--- /dev/null
+++ b/cmake/FindUTF8proc.cmake
@@ -0,0 +1,12 @@
+find_path2(UTF8PROC_INCLUDE_DIR utf8proc.h)
+find_library2(UTF8PROC_LIBRARY NAMES utf8proc utf8proc_static)
+find_package_handle_standard_args(UTF8proc DEFAULT_MSG
+ UTF8PROC_LIBRARY UTF8PROC_INCLUDE_DIR)
+mark_as_advanced(UTF8PROC_LIBRARY UTF8PROC_INCLUDE_DIR)
+
+add_library(utf8proc INTERFACE)
+target_include_directories(utf8proc SYSTEM BEFORE INTERFACE ${UTF8PROC_INCLUDE_DIR})
+target_link_libraries(utf8proc INTERFACE ${UTF8PROC_LIBRARY})
+
+#TODO(dundargoc): this is a hack that should ideally be hardcoded into the utf8proc project via configure_command
+target_compile_definitions(utf8proc INTERFACE "UTF8PROC_STATIC")
diff --git a/cmake/FindWasmtime.cmake b/cmake/FindWasmtime.cmake
new file mode 100644
index 0000000000..e6315748b4
--- /dev/null
+++ b/cmake/FindWasmtime.cmake
@@ -0,0 +1,22 @@
+find_path2(WASMTIME_INCLUDE_DIR wasmtime.h)
+find_library2(WASMTIME_LIBRARY wasmtime)
+
+if(WASMTIME_INCLUDE_DIR AND EXISTS "${WASMTIME_INCLUDE_DIR}/wasmtime.h")
+ file(STRINGS ${WASMTIME_INCLUDE_DIR}/wasmtime.h WASMTIME_VERSION REGEX "#define WASMTIME_VERSION")
+ string(REGEX MATCH "[0-9]+\.[0-9]\.[0-9]" WASMTIME_VERSION ${WASMTIME_VERSION})
+endif()
+
+find_package_handle_standard_args(Wasmtime
+ REQUIRED_VARS WASMTIME_INCLUDE_DIR WASMTIME_LIBRARY
+ VERSION_VAR WASMTIME_VERSION)
+
+add_library(wasmtime INTERFACE)
+target_include_directories(wasmtime SYSTEM BEFORE INTERFACE ${WASMTIME_INCLUDE_DIR})
+target_link_libraries(wasmtime INTERFACE ${WASMTIME_LIBRARY})
+
+if(MSVC)
+ target_compile_options(wasmtime INTERFACE -DWASM_API_EXTERN= -DWASI_API_EXTERN=)
+ target_link_libraries(wasmtime INTERFACE ws2_32 advapi32 userenv ntdll shell32 ole32 bcrypt)
+endif()
+
+mark_as_advanced(WASMTIME_INCLUDE_DIR WASMTIME_LIBRARY)