grbc/HConfig
2024-10-13 10:12:24 -04:00

178 lines
4 KiB
Plaintext

grbc_want_version("1.0")
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")
})
local hotwire = grbc_library(LibraryConfig.new({
name = "libhotwire",
language_type = LanguageType.C,
files = {
grbc_file("vendor/hotwire/src/dlopen.c")
},
lib_type = LibraryType.Static,
requirements = {},
compile_flags = {},
linker_flags = {},
include_dirs = {
"vendor/hotwire/src",
},
properties = {
},
package_config = PackageConfig.new({
name = "libhotwire",
libraries = {},
include_dirs = {
grbc_file("vendor/hotwire/src")
},
compile_flags = {},
linker_flags = {},
})
}))
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,
files = {
grbc_file("src/ext_pkg_config.cc"),
grbc_file("src/ext_profiles.cc"),
grbc_file("src/ext_easy.cc"),
grbc_file("src/ext_dynamic.cc"),
grbc_file("src/ext_cmake.cc")
},
lib_type = LibraryType.Static,
requirements = {
},
compile_flags = {},
linker_flags = {},
include_dirs = {
"include",
"vendor/hotwire/src",
"vendor/sol2/include"
},
package_config = PackageConfig.new({
name = "libgrbc_extensions",
libraries = {},
include_dirs = {
grbc_file("include"),
grbc_file("vendor/sol2/include")
},
compile_flags = {},
linker_flags = {},
})
}))
local grbc_lib = grbc_library(LibraryConfig.new({
name = "libgrbc",
language_type = LanguageType.Cpp,
files = {
grbc_file("src/file.cc"),
grbc_file("src/ninja.cc"),
grbc_file("src/platform.cc"),
grbc_file("src/target_exe.cc"),
grbc_file("src/utils.cc"),
grbc_file("src/generator.cc"),
grbc_file("src/target_lib.cc"),
grbc_file("src/package.cc"),
grbc_file("src/ext.cc"),
grbc_file("src/task.cc"),
grbc_file("src/options.cc")
},
lib_type = LibraryType.Static,
requirements = {
grbc_pkg("libhotwire"),
grbc_pkg("libcjson")
},
compile_flags = {},
linker_flags = {},
include_dirs = {
grbc_file("include"),
grbc_file("vendor/sol2/include")
},
package_config = PackageConfig.new({
name = "libgrbc",
libraries = {},
include_dirs = {
grbc_file("include"),
grbc_file("vendor/sol2/include")
},
compile_flags = {},
linker_flags = {},
})
}))
local grbc_exe = grbc_executable(ExecutableConfig.new({
name = "grbc",
language_type = LanguageType.Cpp,
files = {
grbc_file("src/main.cc"),
},
requirements = {
grbc_pkg_config("lua"),
grbc_pkg("libgrbc"),
grbc_pkg("libgrbc_extensions"),
grbc_pkg("libhotwire"),
grbc_pkg("libcjson"),
sdl_pkg
},
compile_flags = {},
linker_flags = {},
include_dirs = {}
}))
-- Output the final build script
grbc_build("ninja")