Esempio n. 1
0
def mkspec_clang_ios_configure(conf,
                               major,
                               minor,
                               min_ios_version,
                               cpu,
                               minimum=False):
    conf.set_mkspec_platform("ios")
    conf.mkspec_clang_configure(major, minor, minimum=minimum)
    conf.mkspec_set_ios_options(min_ios_version, cpu)
Esempio n. 2
0
def mkspec_clang_android_configure(conf, major, minor, prefix, target):
    conf.set_mkspec_platform('android')
    conf.mkspec_clang_configure(major, minor, prefix)
    conf.mkspec_set_android_options()

    # Specify the target architecture as required by clang
    target_flags = ['-target', target]
    conf.env['CFLAGS'] += target_flags
    conf.env['CXXFLAGS'] += target_flags
    conf.env['LINKFLAGS'] += target_flags
Esempio n. 3
0
def get_mkspec_platform(conf):
    # If the MKSPEC_PLATFORM is not set, we auto detect it.
    if not conf.env['MKSPEC_PLATFORM']:
        platform = Utils.unversioned_sys_platform()
        if platform == 'win32':
            platform = 'windows'
        elif platform == 'darwin':
            platform = 'mac'
        conf.set_mkspec_platform(platform)

    return conf.env['MKSPEC_PLATFORM']
Esempio n. 4
0
def get_mkspec_platform(conf):
    # If the MKSPEC_PLATFORM is not set, we auto detect it.
    if not conf.env["MKSPEC_PLATFORM"]:
        platform = Utils.unversioned_sys_platform()
        if platform == "win32":
            platform = "windows"
        elif platform == "darwin":
            platform = "mac"
        conf.set_mkspec_platform(platform)

    return conf.env["MKSPEC_PLATFORM"]
def get_mkspec_platform(conf):
    # If the MKSPEC_PLATFORM is not set, we auto detect it.
    if not conf.env['MKSPEC_PLATFORM']:
        platform = Utils.unversioned_sys_platform()
        if platform == 'win32':
            platform = 'windows'
        elif platform == 'darwin':
            platform = 'mac'
        conf.set_mkspec_platform(platform)

    return conf.env['MKSPEC_PLATFORM']
Esempio n. 6
0
def mkspec_clang_android_configure(conf, major, minor, prefix, target=None):
    conf.set_mkspec_platform('android')
    conf.mkspec_clang_configure(major, minor, prefix)
    conf.mkspec_set_android_options()

    # Specify the target architecture if required. Newer Android toolchains
    # explicitly set the target in the arm-linux-androideabi-clang++ script,
    # so this is no longer needed.
    if target:
        target_flags = ['-target', target]
        conf.env['CFLAGS'] += target_flags
        conf.env['CXXFLAGS'] += target_flags
        conf.env['LINKFLAGS'] += target_flags
Esempio n. 7
0
def mkspec_clang_android_configure(conf, major, minor, prefix, target=None):
    conf.set_mkspec_platform("android")
    conf.mkspec_clang_configure(major, minor, prefix)
    conf.mkspec_set_android_options()

    # Specify the target architecture if required. Newer Android toolchains
    # explicitly set the target in the arm-linux-androideabi-clang++ script,
    # so this is no longer needed.
    if target:
        target_flags = ["-target", target]
        conf.env["CFLAGS"] += target_flags
        conf.env["CXXFLAGS"] += target_flags
        conf.env["LINKFLAGS"] += target_flags

    if major == 5 and minor == 0:
        # This warning is broken in clang 5.0.300080 (Android NDK r16b).
        # The flag is not needed for newer versions that include this patch:
        # https://reviews.llvm.org/D33526
        conf.env["CXXFLAGS"] += ["-Wno-unused-lambda-capture"]
Esempio n. 8
0
def mkspec_clang_android_configure(conf, major, minor, prefix, target=None):
    conf.set_mkspec_platform('android')
    conf.mkspec_clang_configure(major, minor, prefix)
    conf.mkspec_set_android_options()

    # Specify the target architecture if required. Newer Android toolchains
    # explicitly set the target in the arm-linux-androideabi-clang++ script,
    # so this is no longer needed.
    if target:
        target_flags = ['-target', target]
        conf.env['CFLAGS'] += target_flags
        conf.env['CXXFLAGS'] += target_flags
        conf.env['LINKFLAGS'] += target_flags

    if major == 5 and minor == 0:
        # This warning is broken in clang 5.0.300080 (Android NDK r16b).
        # The flag is not needed for newer versions that include this patch:
        # https://reviews.llvm.org/D33526
        conf.env['CXXFLAGS'] += ['-Wno-unused-lambda-capture']
Esempio n. 9
0
def mkspec_gxx_android_configure(conf, major, minor, prefix):
    conf.set_mkspec_platform('android')
    conf.mkspec_gxx_configure(major, minor, prefix)
    conf.mkspec_set_android_options()
Esempio n. 10
0
def mkspec_gxx_android_configure(conf, major, minor, prefix):
    conf.set_mkspec_platform('android')
    conf.mkspec_gxx_configure(major, minor, prefix)
    conf.mkspec_set_android_options()
Esempio n. 11
0
def mkspec_emscripten_configure(conf, major, minor, minimum=False,
                                force_debug=False):
    """
    :param force_debug: Always compile with debugging flags, if true
    """
    # The path to the emscripten compiler
    paths = conf.get_tool_option('emscripten_path')

    # The node.js binary can be "nodejs" or simply "node"
    conf.find_program(['nodejs', 'node'], var='NODEJS')

    # Find the clang++ compiler
    cxx = conf.find_program(['em++'], path_list=paths)
    cxx = conf.cmd_to_list(cxx)
    conf.env['CXX'] = cxx
    conf.env['CXX_NAME'] = os.path.basename(conf.env.get_flat('CXX'))

    conf.check_emscripten_version(cxx, major, minor, minimum)

    # Find clang as the C compiler
    cc = conf.find_program(['emcc'], path_list=paths)
    cc = conf.cmd_to_list(cc)
    conf.env['CC'] = cc
    conf.env['CC_NAME'] = os.path.basename(conf.env.get_flat('CC'))

    conf.check_emscripten_version(cc, major, minor, minimum)

    # Find the archiver
    conf.find_program('emar', path_list=paths, var='AR')
    conf.env.ARFLAGS = 'rcs'

    # Set up C++ tools and flags
    conf.gxx_common_flags()
    #conf.gxx_modifier_platform()
    conf.cxx_load_tools()
    conf.cxx_add_flags()

    # Also set up C tools and flags
    conf.gcc_common_flags()
    #conf.gcc_modifier_platform()
    conf.cc_load_tools()
    conf.cc_add_flags()

    # Add linker flags
    conf.link_add_flags()

    # Add our own cxx flags
    conf.env['CXXFLAGS'] += ['-O2', '-Wextra', '-Wall']

    if conf.has_tool_option('cxx_debug') or force_debug:
        conf.env['CXXFLAGS'] += ['-g']
        conf.env['LINKFLAGS'] += ['-s']

    if conf.has_tool_option('cxx_nodebug'):
        conf.env['DEFINES'] += ['NDEBUG']

    conf.env['CXXFLAGS'] += ['-std=c++0x']

    # Add our own cc flags
    conf.env['CFLAGS'] += ['-O2', '-Wextra', '-Wall']

    if conf.has_tool_option('cxx_debug') or force_debug:
        conf.env['CFLAGS'] += ['-g']

    if conf.has_tool_option('cxx_nodebug'):
        conf.env['DEFINES'] += ['NDEBUG']

    conf.env['cprogram_PATTERN'] = conf.env['cxxprogram_PATTERN'] = '%s.js'

    conf.set_mkspec_platform('emscripten')
Esempio n. 12
0
def mkspec_clang_ios_configure(conf, major, minor, min_ios_version, cpu):
    conf.set_mkspec_platform('ios')
    conf.mkspec_clang_configure(major, minor)
    conf.mkspec_set_ios_options(min_ios_version, cpu)
Esempio n. 13
0
def mkspec_emscripten_configure(conf, major, minor, minimum=False, force_debug=False):
    """
    :param force_debug: Always compile with debugging flags, if true
    """
    conf.set_mkspec_platform("emscripten")

    # The path to the emscripten compiler
    paths = conf.get_tool_option("emscripten_path")

    # The node.js binary can be "nodejs" or simply "node"
    conf.find_program(["nodejs", "node"], var="NODEJS")

    # Find the clang++ compiler
    cxx = conf.find_program(["em++"], path_list=paths)
    cxx = conf.cmd_to_list(cxx)
    conf.env["CXX"] = cxx
    conf.env["CXX_NAME"] = os.path.basename(conf.env.get_flat("CXX"))

    conf.check_emscripten_version(cxx, major, minor, minimum)

    # Find clang as the C compiler
    cc = conf.find_program(["emcc"], path_list=paths)
    cc = conf.cmd_to_list(cc)
    conf.env["CC"] = cc
    conf.env["CC_NAME"] = os.path.basename(conf.env.get_flat("CC"))

    conf.check_emscripten_version(cc, major, minor, minimum)

    # Find the archiver
    conf.find_program("emar", path_list=paths, var="AR")
    conf.env.ARFLAGS = ["rcs"]

    # Set up C++ tools and flags
    conf.gxx_common_flags()
    conf.cxx_load_tools()
    conf.cxx_add_flags()

    # Also set up C tools and flags
    conf.gcc_common_flags()
    conf.cc_load_tools()
    conf.cc_add_flags()

    # Add linker flags
    conf.link_add_flags()

    # Add the special flags required for emscripten
    conf.env.cshlib_PATTERN = "%s.js"
    conf.env.cxxshlib_PATTERN = "%s.js"
    conf.env.cstlib_PATTERN = "%s.a"
    conf.env.cxxstlib_PATTERN = "%s.a"
    conf.env.cprogram_PATTERN = conf.env.cxxprogram_PATTERN = "%s.js"
    conf.env.CXX_TGT_F = ["-c", "-o", ""]
    conf.env.CC_TGT_F = ["-c", "-o", ""]
    conf.env.CXXLNK_TGT_F = ["-o", ""]
    conf.env.CCLNK_TGT_F = ["-o", ""]
    conf.env.append_value("LINKFLAGS", ["-Wl,--enable-auto-import"])

    # Add our own cxx flags
    conf.env["CXXFLAGS"] += ["-Wextra", "-Wall", "-Wno-warn-absolute-paths"]

    if conf.has_tool_option("cxx_debug") or force_debug:
        conf.env["CXXFLAGS"] += ["-g"]
        conf.env["LINKFLAGS"] += ["-s"]

        # Don't add any optimization flags
        conf.env["MKSPEC_DISABLE_OPTIMIZATION"] = True

    cxxoptflags = ["-O2"]

    if not conf.env["MKSPEC_DISABLE_OPTIMIZATION"]:
        conf.env["CXXFLAGS"] += cxxoptflags

    if conf.has_tool_option("cxx_nodebug"):
        conf.env["DEFINES"] += ["NDEBUG"]

    conf.env["CXXFLAGS"] += ["-std=c++11"]

    if conf.has_tool_option("cxx_debug") or force_debug:
        conf.env["CFLAGS"] += ["-g"]
        # Don't add any optimization flags
        conf.env["MKSPEC_DISABLE_OPTIMIZATION"] = True

    coptflags = ["-O2"]

    if not conf.env["MKSPEC_DISABLE_OPTIMIZATION"]:
        conf.env["CFLAGS"] += coptflags

    # Add our own cc flags
    conf.env["CFLAGS"] += ["-Wextra", "-Wall", "-Wno-warn-absolute-paths"]

    if conf.has_tool_option("cxx_nodebug"):
        conf.env["DEFINES"] += ["NDEBUG"]
Esempio n. 14
0
def mkspec_emscripten_configure(conf, major, minor, minimum=False,
                                force_debug=False):
    """
    :param force_debug: Always compile with debugging flags, if true
    """
    conf.set_mkspec_platform('emscripten')

    # The path to the emscripten compiler
    paths = conf.get_tool_option('emscripten_path')

    # The node.js binary can be "nodejs" or simply "node"
    conf.find_program(['nodejs', 'node'], var='NODEJS')

    # Find the clang++ compiler
    cxx = conf.find_program(['em++'], path_list=paths)
    cxx = conf.cmd_to_list(cxx)
    conf.env['CXX'] = cxx
    conf.env['CXX_NAME'] = os.path.basename(conf.env.get_flat('CXX'))

    conf.check_emscripten_version(cxx, major, minor, minimum)

    # Find clang as the C compiler
    cc = conf.find_program(['emcc'], path_list=paths)
    cc = conf.cmd_to_list(cc)
    conf.env['CC'] = cc
    conf.env['CC_NAME'] = os.path.basename(conf.env.get_flat('CC'))

    conf.check_emscripten_version(cc, major, minor, minimum)

    # Find the archiver
    conf.find_program('emar', path_list=paths, var='AR')
    conf.env.ARFLAGS = ['rcs']

    # Set up C++ tools and flags
    conf.gxx_common_flags()
    conf.cxx_load_tools()
    conf.cxx_add_flags()

    # Also set up C tools and flags
    conf.gcc_common_flags()
    conf.cc_load_tools()
    conf.cc_add_flags()

    # Add linker flags
    conf.link_add_flags()

    # Add the special flags required for emscripten
    conf.env.cshlib_PATTERN = '%s.js'
    conf.env.cxxshlib_PATTERN = '%s.js'
    conf.env.cstlib_PATTERN = '%s.a'
    conf.env.cxxstlib_PATTERN = '%s.a'
    conf.env.cprogram_PATTERN = conf.env.cxxprogram_PATTERN = '%s.js'
    conf.env.CXX_TGT_F = ['-c', '-o', '']
    conf.env.CC_TGT_F = ['-c', '-o', '']
    conf.env.CXXLNK_TGT_F = ['-o', '']
    conf.env.CCLNK_TGT_F = ['-o', '']
    conf.env.append_value('LINKFLAGS',['-Wl,--enable-auto-import'])

    # Add our own cxx flags
    conf.env['CXXFLAGS'] += \
        ['-O2', '-Wextra', '-Wall', '-Wno-warn-absolute-paths']

    if conf.has_tool_option('cxx_debug') or force_debug:
        conf.env['CXXFLAGS'] += ['-g']
        conf.env['LINKFLAGS'] += ['-s']

    if conf.has_tool_option('cxx_nodebug'):
        conf.env['DEFINES'] += ['NDEBUG']

    conf.env['CXXFLAGS'] += ['-std=c++11']

    # Add our own cc flags
    conf.env['CFLAGS'] += \
        ['-O2', '-Wextra', '-Wall', '-Wno-warn-absolute-paths']

    if conf.has_tool_option('cxx_debug') or force_debug:
        conf.env['CFLAGS'] += ['-g']

    if conf.has_tool_option('cxx_nodebug'):
        conf.env['DEFINES'] += ['NDEBUG']
Esempio n. 15
0
def mkspec_emscripten_configure(conf, major, minor, minimum=False,
                                force_debug=False):

    print('***emscripten_common.py::mkspec_emscripten_configure')
    """
    :param force_debug: Always compile with debugging flags, if true
    """
    conf.set_mkspec_platform('emscripten')

    # The path to the emscripten compiler
    paths = conf.get_tool_option('emscripten_path')

    # The node.js binary can be "nodejs" or simply "node"
    conf.find_program(['nodejs', 'node'], var='NODEJS')

    # Find the clang++ compiler
    cxx = conf.find_program(['em++'], path_list=paths)
    cxx = conf.cmd_to_list(cxx)
    conf.env['CXX'] = cxx
    conf.env['CXX_NAME'] = os.path.basename(conf.env.get_flat('CXX'))

    conf.check_emscripten_version(cxx, major, minor, minimum)

    # Find clang as the C compiler
    cc = conf.find_program(['emcc'], path_list=paths)
    cc = conf.cmd_to_list(cc)
    conf.env['CC'] = cc
    conf.env['CC_NAME'] = os.path.basename(conf.env.get_flat('CC'))

    conf.check_emscripten_version(cc, major, minor, minimum)

    # Find the archiver
    conf.find_program('emar', path_list=paths, var='AR')
    conf.env.ARFLAGS = ['rcs']

    # Set up C++ tools and flags
    conf.gxx_common_flags()
    conf.cxx_load_tools()
    conf.cxx_add_flags()

    # Also set up C tools and flags
    conf.gcc_common_flags()
    conf.cc_load_tools()
    conf.cc_add_flags()

    # Add linker flags
    conf.link_add_flags()

    # Add the special flags required for emscripten
    conf.env.cshlib_PATTERN = '%s.js'
    conf.env.cxxshlib_PATTERN = '%s.js'
    conf.env.cstlib_PATTERN = '%s.a'
    conf.env.cxxstlib_PATTERN = '%s.a'
    conf.env.cprogram_PATTERN = conf.env.cxxprogram_PATTERN = '%s.js'
    conf.env.CXX_TGT_F = ['-c', '-o', '']
    conf.env.CC_TGT_F = ['-c', '-o', '']
    conf.env.CXXLNK_TGT_F = ['-o', '']
    conf.env.CCLNK_TGT_F = ['-o', '']
    conf.env.append_value('LINKFLAGS',['-Wl,--enable-auto-import'])

    # Add our own cxx flags
    conf.env['CXXFLAGS'] += \
        ['-O2', '-Wextra', '-Wall', '-Wno-warn-absolute-paths']

    if conf.has_tool_option('cxx_debug') or force_debug:
        conf.env['CXXFLAGS'] += ['-g']
        conf.env['LINKFLAGS'] += ['-s']

    if conf.has_tool_option('cxx_nodebug'):
        conf.env['DEFINES'] += ['NDEBUG']

    conf.env['CXXFLAGS'] += ['-std=c++11']

    # Add our own cc flags
    conf.env['CFLAGS'] += \
        ['-O2', '-Wextra', '-Wall', '-Wno-warn-absolute-paths']

    if conf.has_tool_option('cxx_debug') or force_debug:
        conf.env['CFLAGS'] += ['-g']

    if conf.has_tool_option('cxx_nodebug'):
        conf.env['DEFINES'] += ['NDEBUG']