Skip to content

More optimize options #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,10 @@ The following Unix compiler cc/gcc options are understood by cccl:
- **-dumpversion** Version of cl.exe based on info in copyright banner
- **-g**[0-9] Converts to cl.exe's **/Zi**
- **-O0** Converts to cl.exe's **/Ot** optimization option
- **-O2** and **-O3** Converts to cl.exe's **/O2** optimization option
- **-Ofast** Converts to cl.exe's **/O2** and **/fp:fast** optimization option
- **-Os** Converts to cl.exe's **/O1** optimization option
- **-Oz** Converts to cl.exe's **/Os** optimization option
- **-L<i>path</i>** Converts to linker option **/LIBPATH:_path_**
- **-l<i>library</i>** Converts to **lib_library_.lib** (except **-link**)
- **-m386** Converts to cl.exe's **/G3**
Expand Down
25 changes: 18 additions & 7 deletions cccl
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,22 @@ EOF
clopt+=("${slash}O2")
;;

-O3)
clopt+=("${slash}O2")
;;

-Ofast)
clopt+=("${slash}O2" "${slash}fp:fast")
;;

-Os)
clopt+=("${slash}O1")
;;

-Oz)
clopt+=("${slash}Os")
;;

-L)
shift
path=`echo "$1"`
Expand Down Expand Up @@ -310,12 +326,7 @@ EOF
#ignore aliasing
;;

-isystem)
shift
clopt+=("${slash}I$1")
;;

-I)
-isystem | -I)
shift
clopt+=("${slash}I$1")
;;
Expand Down Expand Up @@ -351,7 +362,7 @@ EOF
fi
;;

*.cc | *.cxx | *.C)
*.cc | *.cxx | *.C | *.c++)
# C++ source file with non .cpp extension, make sure cl understand
# that it is C++
clopt+=("${slash}Tp$1")
Expand Down