Skip to content

Instantly share code, notes, and snippets.

@Ionizing
Created April 20, 2025 13:55
Show Gist options
  • Save Ionizing/1f77941b6d9e0b51bd74e61211d720e5 to your computer and use it in GitHub Desktop.
Save Ionizing/1f77941b6d9e0b51bd74e61211d720e5 to your computer and use it in GitHub Desktop.
xmake configuration for TRIQS/nda
add_rules("mode.release")
set_languages("c++20")
package("nda")
add_deps("cmake")
set_sourcedir("/Users/ionizing/git/nda.src")
on_install(function (package)
local configs = {}
table.insert(configs, "-DOpenMP_CXX_FLAGS=" .. "-Xpreprocessor;-fopenmp;-I/opt/homebrew/opt/libomp/include;-L/opt/homebrew/opt/libomp/lib;-lomp")
table.insert(configs, "-DOpenMP_CXX_LIB_NAMES=" .. "libomp")
table.insert(configs, "-DOpenMP_libomp_LIBRARY=" .. "/opt/homebrew/opt/libomp/lib/libomp.dylib")
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
import("package.tools.cmake").install(package, configs)
end)
package_end()
add_requires("nda")
target("hello-world")
set_kind("binary")
add_files("src/*.cpp")
add_linkdirs("/opt/homebrew/opt/openblas/lib", "/opt/homebrew/opt/libomp/lib")
add_syslinks("openblas", "omp")
add_packages("nda")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment