58 lines
1.4 KiB
Lua
58 lines
1.4 KiB
Lua
target("hpr")
|
|
set_kind("shared")
|
|
set_languages("c++20")
|
|
|
|
set_policy("build.c++.modules", false)
|
|
|
|
add_options("scalar", "scalar_implementation")
|
|
|
|
add_includedirs("..", { public = true })
|
|
|
|
add_headerfiles("../(hpr/*.hpp)")
|
|
add_headerfiles("../(hpr/*/*.hpp)")
|
|
|
|
add_files("hpr.cpp")
|
|
|
|
-- export all symbols for windows/dll
|
|
if is_plat("windows") and is_kind("shared") then
|
|
if is_mode("release") then
|
|
set_optimize("fastest")
|
|
end
|
|
add_rules("utils.symbols.export_all")
|
|
end
|
|
|
|
-- install importfiles for pkg-config/cmake
|
|
add_rules("utils.install.cmake_importfiles")
|
|
add_rules("utils.install.pkgconfig_importfiles")
|
|
|
|
-- add packages
|
|
for _, name in ipairs({"imgui", "implot", "glfw", "opencascade"}) do
|
|
add_packages(name)
|
|
if has_package(name) then
|
|
set_configvar("HPR_HAVE_PACKAGE_" .. name:upper(), 1)
|
|
end
|
|
end
|
|
target_end()
|
|
|
|
|
|
for _, file in ipairs(os.files("tests/test_*.cpp")) do
|
|
local name = path.basename(file)
|
|
target(name)
|
|
set_kind("binary")
|
|
set_default(false)
|
|
set_languages("c++20")
|
|
|
|
set_policy("build.c++.modules", false)
|
|
|
|
add_options("scalar", "scalar_implementation")
|
|
|
|
add_packages("gtest")
|
|
|
|
add_includedirs("..", { public = true })
|
|
|
|
add_files(file)
|
|
|
|
add_tests("default")
|
|
target_end()
|
|
end
|