-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
899 additions
and
38 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
doc/examples/basic/meta.yaml → doc/examples/basic/conda/libbasic/meta.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package: | ||
name: python-basic | ||
version: "1.0.0" | ||
|
||
source: | ||
path: ../.. | ||
|
||
build: | ||
number: 0 | ||
script: | ||
- scons py --prefix={{ PREFIX }} -j{{ CPU_COUNT }} | ||
- python setup.py install | ||
|
||
about: | ||
home: http://autowig.readthedocs.io/ | ||
license: CeCILL-C | ||
|
||
requirements: | ||
build: | ||
- scons | ||
- libboost | ||
- libbasic | ||
run: | ||
- libboost | ||
- libbasic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import os | ||
from setuptools import setup, find_packages | ||
|
||
packages = {"" : "src" + os.sep + "py"} | ||
for package in find_packages("src" + os.sep + "py"): | ||
packages[package] = "src" + os.sep + "py" | ||
|
||
setup(packages = packages.keys(), | ||
package_dir = {"" : "src" + os.sep + "py"}, | ||
name = 'basic', | ||
version = '1.0.0', | ||
author = 'Pierre Fernique', | ||
author_email = 'pfernique@gmail.com', | ||
description = 'A basic library', | ||
long_description = 'This library is designed to be an example for AutoWIG', | ||
license = 'none', | ||
package_data = {package: [ "*.so", "*.dll"] for package in packages}, | ||
zip_safe = False) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# -*-python-*- | ||
|
||
|
||
import SCons.Action | ||
import SCons.Builder | ||
import SCons.Scanner.C | ||
import SCons.Util | ||
import SCons.Script | ||
|
||
import os | ||
bn = os.path.basename | ||
|
||
Import("env") | ||
|
||
cppenv = env.Clone() | ||
|
||
headers = cppenv.Glob('*.h*') | ||
includes = cppenv.Install(os.path.join(cppenv['PREFIX'], "include", "basic"), headers) | ||
|
||
Alias("cpp", includes) | ||
Alias("build", includes) | ||
|
||
sources = cppenv.Glob('*.cpp') | ||
if cppenv.get("static"): | ||
lib = cppenv.StaticLibrary(os.path.join(cppenv['PREFIX'], "lib", "basic"), sources) | ||
else: | ||
lib = cppenv.SharedLibrary(os.path.join(cppenv['PREFIX'], "lib", "basic"), sources) | ||
Alias("cpp", lib) | ||
Alias("build", lib) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# -*-python-*- | ||
|
||
import os | ||
import sys | ||
import itertools | ||
from distutils import sysconfig | ||
|
||
operating_system = os.name.lower() | ||
platform = sys.platform.lower() | ||
|
||
Import("env") | ||
|
||
pyenv = env.Clone() | ||
|
||
header = pyenv.Glob('*.h') | ||
if len(header) == 1: | ||
cmd = pyenv.Command(header[0].target_from_source('', '.h.gch'), header, '$CXX -o $TARGET -x c++-header -c -fPIC $SHCXXFLAGS $_CCCOMCOM $SOURCE') | ||
|
||
targets = list(itertools.chain(*[pyenv.SharedObject(None, source) for source in pyenv.Glob('*.cpp')])) | ||
if len(header) == 1: | ||
pyenv.Depends(targets, cmd) | ||
|
||
source = pyenv.File('response_file.rsp') | ||
with open(source.abspath, 'w') as filehandler: | ||
filehandler.write(' '.join(target.abspath.replace('\\','/') + ' ' for target in targets)) | ||
|
||
pyenv.AppendUnique(LINKFLAGS = ['@' + source.abspath]) | ||
target = str(pyenv.File("basic/__module").srcnode()) | ||
|
||
pyenv.AppendUnique(LIBS = ['basic']) | ||
|
||
kwargs = dict() | ||
|
||
if operating_system == 'nt': | ||
kwargs['SHLIBSUFFIX'] = '.pyd' | ||
else: | ||
kwargs['SHLIBSUFFIX'] = '.so' | ||
|
||
kwargs['SHLIBPREFIX'] = '' | ||
|
||
if operating_system == "posix": | ||
pyenv.AppendUnique(CXXFLAGS = ['-ftemplate-depth-100']) | ||
|
||
|
||
|
||
wrap = pyenv.LoadableModule(target, [], LDMODULESUFFIX='.so', | ||
FRAMEWORKSFLAGS = '-flat_namespace -undefined suppress', **kwargs) | ||
pyenv.Depends(wrap, targets) | ||
|
||
Alias("py", wrap) | ||
Alias("build", wrap) |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
__all__ = [] | ||
|
||
|
||
# Import Boost.Python module | ||
import basic.__module | ||
|
||
|
||
|