cmake interop work

This commit is contained in:
Hunter 2024-10-13 10:12:24 -04:00
parent 29afc49c36
commit ca96457590
9 changed files with 3718 additions and 40 deletions

49
HConfig
View file

@ -3,6 +3,15 @@ grbc_ext("GRBC_EXT_pkg_config")
grbc_ext("GRBC_EXT_profiles")
grbc_ext("GRBC_EXT_easy")
grbc_ext("GRBC_EXT_dynamic_extensions")
grbc_ext("GRBC_EXT_cmake")
local cmake_project = grbc_import_cmake("/tmp/SDL", CMakeConfig.new({
configure_arguments = {}
}))
print(cmake_project:get_library_string())
local sdl_pkg = cmake_project:get_library("SDL3-shared")
grbc_global_properties({
grbc_cxx_version("c++17")
@ -38,6 +47,36 @@ local hotwire = grbc_library(LibraryConfig.new({
})
}))
local cjson = grbc_library(LibraryConfig.new({
name = "libcjson",
language_type = LanguageType.C,
files = {
grbc_file("src/cJSON.c")
},
lib_type = LibraryType.Static,
requirements = {},
compile_flags = {},
linker_flags = {},
include_dirs = {
"include/grbc",
},
properties = {
},
package_config = PackageConfig.new({
name = "libcjson",
libraries = {},
include_dirs = {
grbc_file("include/grbc")
},
compile_flags = {},
linker_flags = {},
})
}))
local grbc_extensions = grbc_library(LibraryConfig.new({
name = "libgrbc_extensions",
language_type = LanguageType.Cpp,
@ -50,7 +89,8 @@ local grbc_extensions = grbc_library(LibraryConfig.new({
},
lib_type = LibraryType.Static,
requirements = {},
requirements = {
},
compile_flags = {},
linker_flags = {},
@ -91,7 +131,8 @@ local grbc_lib = grbc_library(LibraryConfig.new({
lib_type = LibraryType.Static,
requirements = {
grbc_pkg("libhotwire")
grbc_pkg("libhotwire"),
grbc_pkg("libcjson")
},
compile_flags = {},
linker_flags = {},
@ -123,7 +164,9 @@ local grbc_exe = grbc_executable(ExecutableConfig.new({
grbc_pkg_config("lua"),
grbc_pkg("libgrbc"),
grbc_pkg("libgrbc_extensions"),
grbc_pkg("libhotwire")
grbc_pkg("libhotwire"),
grbc_pkg("libcjson"),
sdl_pkg
},
compile_flags = {},
linker_flags = {},