intf_libs = # Interface dependencies.
impl_libs = # Implementation dependencies.
#import xxxx_libs += libhello%lib{hello}

# Public headers.
#
pub = [dir_path] ../include/

include $pub

pub_hdrs = $($pub/ pub_hdrs)

lib{minhook}: $pub/{$pub_hdrs}

# Private headers and sources as well as dependencies.
#
lib{minhook}: {h c}{**} $impl_libs $intf_libs

# On Windows, export the public MH_* symbols via the upstream module-definition
# file (matching upstream's MinHook.dll ABI). This only applies to the shared
# library member. That is, the static library needs no exports.
#
libs{minhook}: def{MinHook}: include = ($c.target.class == 'windows')

# Build options.
#
out_pfx_inc = [dir_path] $out_root/include/
src_pfx_inc = [dir_path] $src_root/include/
out_pfx_src = [dir_path] $out_root/src/
src_pfx_src = [dir_path] $src_root/src/

c.poptions =+ "-I$out_pfx_src" "-I$src_pfx_src" \
              "-I$out_pfx_inc" "-I$src_pfx_inc"

#obja{*}: c.poptions += -DLIBMINHOOK_STATIC_BUILD
#objs{*}: c.poptions += -DLIBMINHOOK_SHARED_BUILD

# Export options.
#
lib{minhook}:
{
  c.export.poptions = "-I$out_pfx_inc" "-I$src_pfx_inc"
  c.export.libs = $intf_libs
}

#liba{minhook}: c.export.poptions += -DLIBMINHOOK_STATIC
#libs{minhook}: c.export.poptions += -DLIBMINHOOK_SHARED

# For pre-releases use the complete version to make sure they cannot
# be used in place of another pre-release or the final version. See
# the version module for details on the version.* variable values.
#
if $version.pre_release
  lib{minhook}: bin.lib.version = "-$version.project_id"
else
  lib{minhook}: bin.lib.version = "-$version.major.$version.minor"

# Don't install private headers.
#
h{*}: install = false
