-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Rian Quinn <“[email protected]”>
- Loading branch information
Rian Quinn
committed
Aug 10, 2017
0 parents
commit e6bf1cf
Showing
30 changed files
with
24,085 additions
and
0 deletions.
There are no files selected for viewing
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,79 @@ | ||
cmake_minimum_required(VERSION 2.8.4) | ||
project(astyle CXX) | ||
|
||
# Version | ||
set(MAJOR_VERSION 3) | ||
set(MINOR_VERSION 0) | ||
set(PATCH_VERSION 0) | ||
|
||
# Options | ||
option(BUILD_JAVA_LIBS "Build shared library" OFF) | ||
option(BUILD_SHARED_LIBS "Build shared library" OFF) | ||
option(BUILD_STATIC_LIBS "Build static library" OFF) | ||
|
||
# If a java library is requested, shared libraries should be enabled | ||
# Also, make sure java is installed | ||
if(BUILD_JAVA_LIBS) | ||
if(NOT EXISTS /usr/lib/jvm/default-java/include) | ||
message(FATAL_ERROR "jvm-dev not installed") | ||
endif() | ||
set(BUILD_SHARED_LIBS ON) | ||
endif() | ||
|
||
# Executable Sources | ||
list(APPEND exe_SRCS | ||
src/ASBeautifier.cpp | ||
src/ASEnhancer.cpp | ||
src/ASFormatter.cpp | ||
src/ASLocalizer.cpp | ||
src/ASResource.cpp | ||
src/astyle_main.cpp | ||
) | ||
|
||
# Library Sources | ||
list(APPEND lib_SRCS | ||
src/ASBeautifier.cpp | ||
src/ASEnhancer.cpp | ||
src/ASFormatter.cpp | ||
src/ASResource.cpp | ||
src/astyle_main.cpp | ||
) | ||
|
||
# Release build by default | ||
if(NOT CMAKE_BUILD_TYPE) | ||
set(CMAKE_BUILD_TYPE "Release") | ||
endif() | ||
|
||
# Define the output type | ||
if(BUILD_SHARED_LIBS OR BUILD_STATIC_LIBS) | ||
add_library(astyle ${lib_SRCS}) | ||
install(TARGETS astyle DESTINATION lib) | ||
else() | ||
add_executable(astyle ${exe_SRCS}) | ||
install(TARGETS astyle DESTINATION bin) | ||
endif() | ||
|
||
# Default compile options | ||
if(NOT WIN32 STREQUAL "1") | ||
target_compile_options(astyle PRIVATE -Wall -fno-rtti -fno-exceptions -std=c++11) | ||
else() | ||
target_compile_options(astyle PRIVATE /EHsc) | ||
endif() | ||
|
||
# Turn off debugging on release builds | ||
if(CMAKE_BUILD_TYPE STREQUAL "Release") | ||
target_compile_options(astyle PRIVATE -DNDEBUG) | ||
endif() | ||
|
||
# Build specific compile options | ||
if(BUILD_SHARED_LIBS OR BUILD_STATIC_LIBS) | ||
if(BUILD_JAVA_LIBS) | ||
target_compile_options(astyle PRIVATE -DASTYLE_JNI) | ||
target_compile_options(astyle PRIVATE -I/usr/lib/jvm/default-java/include ) | ||
target_compile_options(astyle PRIVATE -I/usr/lib/jvm/default-java/include/linux ) | ||
else() | ||
target_compile_options(astyle PRIVATE -DASTYLE_LIB) | ||
endif() | ||
set_property(TARGET astyle PROPERTY VERSION ${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}) | ||
set_property(TARGET astyle PROPERTY SOVERSION ${MAJOR_VERSION}) | ||
endif() |
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,21 @@ | ||
### MIT License | ||
|
||
Copyright (c) 2017 by Jim Pattee <[email protected]>. | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
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,9 @@ | ||
Instructions for using Artistic Style are included in the *doc* directory. | ||
|
||
The file **install.html** contains instructions for compiling and | ||
installing Artistic Style. | ||
|
||
The file **astyle.html**' contains information on using Artistic Style. | ||
|
||
The files **news.html** and **notes.html** contain information on changes | ||
made to the various releases. |
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.