Skip to content

Commit

Permalink
Synced with Perforce
Browse files Browse the repository at this point in the history
Updated readthedocs
  • Loading branch information
burgerbecky committed Jul 19, 2024
1 parent fea248a commit 03fc0a1
Show file tree
Hide file tree
Showing 29 changed files with 360 additions and 139 deletions.
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Please?

--------------------------------------------

Copyright (c) 2013-2019 Rebecca Ann Heineman <becky@burgerbecky.com>
Copyright (c) 2013-2024 Rebecca Ann Heineman <becky@burgerbecky.com>

--------------------------------------------

Expand Down
320 changes: 226 additions & 94 deletions docs/Doxyfile

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@
# ]

# rst2pdf has a bug where indexes can't build, this is a workaround
#pdf_use_index = False
# pdf_use_index = False

# -- Extension configuration -------------------------------------------------

Expand Down Expand Up @@ -260,10 +260,10 @@ def generate_doxygen_xml(app):
if not os.path.isfile(doxygen):
try:
subprocess.call(("curl -O "
"http://logicware.com/downloads/linux/doxygen-1.9.5.tgz"),
"http://logicware.com/downloads/linux/doxygen-1.11.0.tgz"),
cwd=CWD,
shell=True)
subprocess.call("tar -xvf doxygen-1.9.5.tgz", cwd=CWD,
subprocess.call("tar -xvf doxygen-1.11.0.tgz", cwd=CWD,
shell=True)
except OSError as error:
sys.stderr.write("doxygen download error: %s" % error)
Expand All @@ -284,7 +284,9 @@ def generate_doxygen_xml(app):
if _ON_RTD:
try:
retcode = subprocess.call(
"cp -r temp/html _build/html/doxygen", cwd=".", shell=True)
"cp -r temp/html ../_readthedocs/html/doxygen",
cwd=".",
shell=True)
if retcode < 0:
sys.stderr.write("cp terminated by signal %s" % (-retcode))
except OSError as error:
Expand Down
12 changes: 6 additions & 6 deletions makeprojects/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
Chapter list
============
- @subpage md_buildme_man Instructions for buildme
- @subpage md_cleanme_man Instructions for cleanme
- @subpage md_rebuildme_man Instructions for rebuildme
- @subpage md_build_rules_man Layout of ``build_rules.py``
- @subpage md_buildme__man Instructions for buildme
- @subpage md_cleanme__man Instructions for cleanme
- @subpage md_rebuildme__man Instructions for rebuildme
- @subpage md_build__rules__man Layout of ``build_rules.py``
@par To use in your own script:
Expand Down Expand Up @@ -78,7 +78,7 @@
########################################

# Current version of the library as a numeric tuple
__numversion__ = (0, 15, 1)
__numversion__ = (0, 15, 2)

# Current version of the library
__version__ = ".".join([str(num) for num in __numversion__])
Expand All @@ -102,7 +102,7 @@
__license__ = "MIT License"

# Copyright owner
__copyright__ = "Copyright 2013-2023 Rebecca Ann Heineman"
__copyright__ = "Copyright 2013-2024 Rebecca Ann Heineman"

# Items to import on "from makeprojects import *"
__all__ = [
Expand Down
2 changes: 1 addition & 1 deletion makeprojects/buildme.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Scan the current directory and all project files will be built.
Full documentation is here, @subpage md_buildme_man
Full documentation is here, @subpage md_buildme__man
See Also:
main, makeprojects.cleanme, makeprojects.rebuildme
Expand Down
2 changes: 1 addition & 1 deletion makeprojects/codeblocks.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# Copyright 1995-2022 by Rebecca Ann Heineman becky@burgerbecky.com
# Copyright 1995-2024 by Rebecca Ann Heineman becky@burgerbecky.com

# It is released under an MIT Open Source license. Please see LICENSE
# for license details. Yes, you can use it in a
Expand Down
10 changes: 6 additions & 4 deletions makeprojects/codewarrior.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
Tab character for XML output
"""

# Copyright 2019-2022 by Rebecca Ann Heineman becky@burgerbecky.com
# Copyright 2019-2024 by Rebecca Ann Heineman becky@burgerbecky.com

# It is released under an MIT Open Source license. Please see LICENSE
# for license details. Yes, you can use it in a
Expand Down Expand Up @@ -788,15 +788,17 @@ class MWFrontEnd_C(object):
settings: List of setting objects for this generator
"""

def __init__(self):
def __init__(self, configuration):
"""
Initialize
"""

exceptions = "1" if configuration.exceptions else "0"
self.settings = [
SETTING("MWFrontEnd_C_cplusplus", "0"),
SETTING("MWFrontEnd_C_templateparser", "1"),
SETTING("MWFrontEnd_C_instance_manager", "1"),
SETTING("MWFrontEnd_C_enableexceptions", "0"),
SETTING("MWFrontEnd_C_enableexceptions", exceptions),
SETTING("MWFrontEnd_C_useRTTI", "0"),
SETTING("MWFrontEnd_C_booltruefalse", "1"),
SETTING("MWFrontEnd_C_wchar_type", "1"),
Expand Down Expand Up @@ -1502,7 +1504,7 @@ def __init__(self, solution, projectname=None,
# Generic settings for all platforms

# C/C++ Language
target.settinglist.append(MWFrontEnd_C())
target.settinglist.append(MWFrontEnd_C(configuration))

definelist = configuration.get_chained_list("define_list")
# C/C++ Preprocessor
Expand Down
2 changes: 1 addition & 1 deletion makeprojects/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
Full pathname of the configuration file
"""

# Copyright 2013-2023 by Rebecca Ann Heineman becky@burgerbecky.com
# Copyright 2013-2024 by Rebecca Ann Heineman becky@burgerbecky.com
#
# It is released under an MIT Open Source license. Please see LICENSE
# for license details. Yes, you can use it in a
Expand Down
25 changes: 25 additions & 0 deletions makeprojects/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class Attributes(object):
debug: Boolean for debug information generation
link_time_code_generation: Boolean for LTCG
optimization: Boolean for optimization enable
exceptions: Boolean for enabling C++ exceptions
analyze: Boolean for code analysis
use_mfc: Boolean for Microsoft Foundation Classes usage
use_atl: Boolean for Active Template Library usage
Expand All @@ -67,6 +68,7 @@ class Attributes(object):
_debug: True @ref makeprojects.core.Attributes.debug
_link_time_code_generation: True @ref makeprojects.core.Attributes.link_time_code_generation
_optimization: True @ref makeprojects.core.Attributes.optimization
_exceptions: False @ref makeprojects.code.Attributes.exceptions
_analyze: True @ref makeprojects.core.Attributes.analyze
_use_mfc: True @ref makeprojects.core.Attributes.use_mfc
_use_atl: True @ref makeprojects.core.Attributes.use_atl
Expand Down Expand Up @@ -115,6 +117,7 @@ def __init__(self):
self._debug = None
self._link_time_code_generation = None
self._optimization = None
self._exceptions = None
self._analyze = None
self._use_mfc = None
self._use_atl = None
Expand Down Expand Up @@ -297,6 +300,27 @@ def _setoptimization(self, value):

########################################

def _getexceptions(self):
"""
Get exceptions boolean
"""

return self.get_chained_value("_exceptions")

def _setexceptions(self, value):
"""
Set the boolean with validation
Args:
self: The "this" reference.
value: None, True or False
"""

self._exceptions = validate_boolean(value)

exceptions = property(_getexceptions, _setexceptions)

########################################

def _getanalyze(self):
"""
Get code analysis boolean
Expand Down Expand Up @@ -614,6 +638,7 @@ class Configuration(Attributes):
- ``define_list`` List of defines for compilation
- ``debug`` True if debugging defaults are enabled
- ``optimization`` 0-4 level of optimization
- ``exceptions`` True if C++ exceptions are enabled
- ``link_time_code_generation`` Enable link time code genration
If any of these attributes are read, they will always return None.
Expand Down
2 changes: 1 addition & 1 deletion makeprojects/enums.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# Copyright 2013-2023 by Rebecca Ann Heineman becky@burgerbecky.com
# Copyright 2013-2024 by Rebecca Ann Heineman becky@burgerbecky.com
#
# It is released under an MIT Open Source license. Please see LICENSE
# for license details. Yes, you can use it in a
Expand Down
2 changes: 1 addition & 1 deletion makeprojects/makefile.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# Copyright 1995-2023 by Rebecca Ann Heineman becky@burgerbecky.com
# Copyright 1995-2024 by Rebecca Ann Heineman becky@burgerbecky.com

# It is released under an MIT Open Source license. Please see LICENSE
# for license details. Yes, you can use it in a
Expand Down
2 changes: 1 addition & 1 deletion makeprojects/ninja.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# Copyright 1995-2022 by Rebecca Ann Heineman becky@burgerbecky.com
# Copyright 1995-2024 by Rebecca Ann Heineman becky@burgerbecky.com

# It is released under an MIT Open Source license. Please see LICENSE
# for license details. Yes, you can use it in a
Expand Down
2 changes: 1 addition & 1 deletion makeprojects/util.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# Copyright 2021-2023 by Rebecca Ann Heineman becky@burgerbecky.com
# Copyright 2021-2024 by Rebecca Ann Heineman becky@burgerbecky.com

# It is released under an MIT Open Source license. Please see LICENSE
# for license details. Yes, you can use it in a
Expand Down
2 changes: 1 addition & 1 deletion makeprojects/validators.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# Copyright 2013-2023 by Rebecca Ann Heineman becky@burgerbecky.com
# Copyright 2013-2024 by Rebecca Ann Heineman becky@burgerbecky.com
#
# It is released under an MIT Open Source license. Please see LICENSE
# for license details. Yes, you can use it in a
Expand Down
11 changes: 9 additions & 2 deletions makeprojects/visual_studio.py
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,7 @@ def BoolExceptionHandling(configuration):
if configuration.ide is IDETypes.vs2003:
return VSBooleanProperty.vs_validate(
'ExceptionHandling', configuration,
False,
True if configuration.exceptions else False,
options_key='compiler_options',
options=(('/EHsc', True), ('/EHa', True)))
return None
Expand Down Expand Up @@ -1839,6 +1839,12 @@ def create_deploy_script(configuration):
create_copy_file_script
"""

# Is there an override?
post_build = configuration.get_chained_value("post_build")
if post_build:
# Return the tuple, message, then command
return post_build

deploy_folder = configuration.deploy_folder

# Don't deploy if no folder is requested.
Expand Down Expand Up @@ -2613,9 +2619,10 @@ def __init__(self, configuration):
self.add_default(BoolExceptionHandling(configuration))

if ide > IDETypes.vs2003:
default = "Yes" if configuration.exceptions else "No"
self.add_default(
VSEnumProperty(
'ExceptionHandling', 'No',
'ExceptionHandling', default,
('No',
('/EHsc', 'Yes'),
('/EHa', 'Yes with SEH', 'Yes with SEH Exceptions'))))
Expand Down
18 changes: 14 additions & 4 deletions makeprojects/visual_studio_2010.py
Original file line number Diff line number Diff line change
Expand Up @@ -1289,10 +1289,20 @@ def __init__(self, configuration):
self.add_tag("ProgramDataBaseFileName", "$(OutDir)$(TargetName).pdb")

# Exception handling
item = "false"
if (platform.is_android() and configuration.ide >= IDETypes.vs2022) \
or platform is PlatformTypes.stadia:
item = "Disabled"
item = configuration.get_chained_value("vs_ExceptionHandling")
if not item:
if configuration.exceptions:
item = "Sync"
if (platform.is_android() and \
configuration.ide >= IDETypes.vs2022) \
or platform is PlatformTypes.stadia:
item = "Enabled"
else:
item = "false"
if (platform.is_android() and \
configuration.ide >= IDETypes.vs2022) \
or platform is PlatformTypes.stadia:
item = "Disabled"
self.add_tag("ExceptionHandling", item)

# Floating point model
Expand Down
12 changes: 10 additions & 2 deletions makeprojects/watcom.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# Copyright 1995-2023 by Rebecca Ann Heineman becky@burgerbecky.com
# Copyright 1995-2024 by Rebecca Ann Heineman becky@burgerbecky.com

# It is released under an MIT Open Source license. Please see LICENSE
# for license details. Yes, you can use it in a
Expand Down Expand Up @@ -43,7 +43,8 @@
from .enums import FileTypes, ProjectTypes, PlatformTypes, IDETypes, \
get_output_template
from .build_objects import BuildObject, BuildError
from .watcom_util import fixup_env, get_custom_list, get_output_list
from .watcom_util import fixup_env, get_custom_list, get_output_list, \
add_post_build

_WATCOMFILE_MATCH = re_compile("(?is).*\\.wmk\\Z")

Expand Down Expand Up @@ -960,6 +961,10 @@ def _setcppflags(self, line_list):
else:
entries.append("-od")

# Enable C++ exceptions
if configuration.exceptions:
entries.append("-xs")

# Add defines
define_list = configuration.get_chained_list("define_list")
for item in define_list:
Expand Down Expand Up @@ -1266,6 +1271,8 @@ def write_builds(self, line_list):
"\t@WLIB -q -b -c -n $^@ @WOW"
])

add_post_build(line_list, configuration)

if configuration.deploy_folder:
deploy_folder = convert_to_windows_slashes(
configuration.deploy_folder,
Expand All @@ -1283,6 +1290,7 @@ def write_builds(self, line_list):
configuration.platform.get_short_code() + ") "
"NAME $^@ FILE @wow"
])
add_post_build(line_list, configuration)

return 0

Expand Down
33 changes: 33 additions & 0 deletions makeprojects/watcom_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ def convert_file_name_watcom(item):
item = item.replace("%(FileName)", "$[&")
item = item.replace("%(FullPath)", "$[@")
item = item.replace("%(Identity)", "$[@")
item = item.replace("$(TargetPath)", "$^@")
return item

########################################
Expand Down Expand Up @@ -212,3 +213,35 @@ def get_output_list(custom_list):
# Sort it
output_list.sort()
return output_list


########################################

def add_post_build(line_list, configuration):
"""
If there are custom build rules, add them
Args:
line_list: Output stream
configuration: Project configuration
"""

# Is there custom post build rule?
post_build = configuration.get_chained_value("post_build")
if not post_build:
return

# Get the command line
cmd = post_build[1]

# Convert Visual Studio environment variables
cmd = convert_file_name_watcom(cmd)

# Convert to Watcom format
cmd = fixup_env(cmd)

# Add the lines
line_list.extend([
"\t@echo " + post_build[0],
"\t@" + cmd
])
Loading

0 comments on commit 03fc0a1

Please sign in to comment.