Skip to content

Commit 53d2a3f

Browse files
author
Food Tiny
authored
Merge pull request #325 from foodtiny/development
Release v1.0.5
2 parents 0102711 + 268f1a3 commit 53d2a3f

11 files changed

Lines changed: 515 additions & 307 deletions

File tree

.gitignore

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,26 @@
22
.DS_Store
33
bin
44
.idea
5+
.vscode
6+
.gradle
57
CMakeFiles
6-
cmake-build-debug
7-
cmake_install.cmake
8+
cmake-*
9+
cmake_*
810
CTestTestfile.cmake
911
install_manifest.txt
1012
CMakeCache.txt
13+
CPack*
14+
_CPack*
1115
DartConfiguration.tcl
1216
Testing
1317
/src
1418
/Makefile
1519
/release/Makefile
1620
/native*
1721
libnative*
18-
/cygnative.dll
1922
/native_benchmark
2023
native_test.exe
2124
build
2225
libbenchmark.gcno
23-
.gradle
24-
gradle
25-
gradlew
26-
gradlew.bat
27-
/remove_old_build.sh
26+
gradle*
2827
/unit_test.sh

CMakeLists.txt

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,20 @@ check_cxx_compiler_flag("-std=gnu++0x" COMPILER_SUPPORTS_CXX0X)
4141

4242
# Check CXX version
4343
if (COMPILER_SUPPORTS_CXX11)
44-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11 -Wfatal-errors")
44+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11 -Wfatal-errors -Wno-multichar")
4545
elseif (COMPILER_SUPPORTS_CXX0X)
46-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++0x -Wfatal-errors")
46+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++0x -Wfatal-errors -Wno-multichar")
4747
else ()
4848
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
4949
endif ()
5050

51-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wfatal-errors")
52-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
51+
# Support for OpenMP
52+
find_package(OpenMP)
53+
if (OPENMP_FOUND)
54+
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
55+
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
56+
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
57+
endif()
5358

5459
# GNU Source compatible
5560
add_definitions(-D_GNU_SOURCE)
@@ -68,9 +73,6 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
6873
endif ()
6974
endif ()
7075

71-
# Dynamic linked library for OSX
72-
set(DYLD_LIBRARY_PATH ${DYLD_LIBRARY_PATH})
73-
7476
# Release mode
7577
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -march=native")
7678

@@ -142,6 +144,26 @@ install(FILES library.hpp DESTINATION ../include/native)
142144
install(DIRECTORY library DESTINATION ../include/native FILES_MATCHING PATTERN "*.hpp")
143145
install(DIRECTORY kernel DESTINATION ../include/native FILES_MATCHING PATTERN "*.hpp")
144146

147+
# Detect operating system
148+
find_file (DEBIAN debian_version debconf.conf PATHS /etc)
149+
find_file (FEDORA fedora-release PATHS /etc)
150+
find_file (REDHAT redhat-release inittab.RH PATHS /etc)
151+
152+
IF (${APPLE})
153+
SET(CPACK_GENERATOR "DMG")
154+
endif()
155+
if (DEBIAN)
156+
SET(CPACK_GENERATOR "DEB")
157+
endif()
158+
if (FEDORA OR REDHAT)
159+
SET(CPACK_GENERATOR "RPM")
160+
endif()
161+
SET(CPACK_PACKAGE_CONTACT "loint.foodtiny@gmail.com")
162+
SET(CPACK_PACKAGE_DESCRIPTION "Native Library for C++")
163+
SET(CPACK_PACKAGE_VERSION "1.0.4")
164+
SET(CPACK_PACKAGE_MAINTAINER "Loi Nguyen")
165+
INCLUDE(CPack)
166+
145167
# Add uninstall
146168
add_custom_target(
147169
uninstall
@@ -152,6 +174,7 @@ add_custom_target(
152174
# Link library for OSX and other platform
153175
# Darwin platform no need to link realtime library (-lrt)
154176
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
177+
set(DYLD_LIBRARY_PATH ${DYLD_LIBRARY_PATH})
155178
target_link_libraries(${PROJECT_NAME} ${CMAKE_THREAD_LIBS_INIT} -lm)
156179
target_link_libraries(${PROJECT_NAME}_test ${CMAKE_THREAD_LIBS_INIT} -lm)
157180
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")

install

Lines changed: 0 additions & 2 deletions
This file was deleted.

library/Java/Lang/Runnable/Runnable.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ namespace Java {
3131
namespace Lang {
3232
class Runnable {
3333
public:
34-
virtual void run() const = 0;
34+
virtual void run() = 0;
3535
};
3636
}
3737
}

0 commit comments

Comments
 (0)