forked from apache/tsfile
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
518 changed files
with
955 additions
and
90 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
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
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
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,84 @@ | ||
#[[ | ||
Licensed to the Apache Software Foundation (ASF) under one | ||
or more contributor license agreements. See the NOTICE file | ||
distributed with this work for additional information | ||
regarding copyright ownership. The ASF licenses this file | ||
to you under the Apache License, Version 2.0 (the | ||
"License"); you may not use this file except in compliance | ||
with the License. You may obtain a copy of the License at | ||
https://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, | ||
software distributed under the License is distributed on an | ||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, either express or implied. See the License for the | ||
specific language governing permissions and limitations | ||
under the License. | ||
]] | ||
|
||
cmake_minimum_required(VERSION 3.20) | ||
|
||
# Set the name of this project | ||
project(TsFile) | ||
|
||
# Set the C language level to C11 | ||
set(CMAKE_C_STANDARD 11) | ||
|
||
# Save the root directory | ||
set(TSFILE_ROOT_DIR ${CMAKE_SOURCE_DIR}) | ||
|
||
# Our link to the maven lifecycle | ||
set(BUILD_PHASE test-compile CACHE STRING "Phase of the Maven build we are executing cmake") | ||
|
||
# Access the Unity version the maven build is providing us with. | ||
set(UNITY_VERSION 2.5.2 CACHE STRING "Version of the used Unity test framework") | ||
|
||
# MinGW GCC versions above 4.7 on Windows include inline definitions of these functions | ||
# If you run into problems, please read this article: https://stackoverflow.com/questions/27853225/is-there-a-way-to-include-stdio-h-but-ignore-some-of-the-functions-therein | ||
# These are the constants needed to activate all patches. | ||
add_compile_definitions(NO_INLINE_VFSCANF=1) | ||
add_compile_definitions(NO_INLINE_VSSCANF=1) | ||
add_compile_definitions(NO_INLINE_VSCANF=1) | ||
add_compile_definitions(NO_INLINE_VSNPRINTF=1) | ||
add_compile_definitions(NO_INLINE_SNPRINTF=1) | ||
add_compile_definitions(NO_INLINE_VFWSCANF=1) | ||
add_compile_definitions(NO_INLINE_VSWSCANF=1) | ||
add_compile_definitions(NO_INLINE_VWSCANF=1) | ||
add_compile_definitions(NO_INLINE_SNWPRINTF=1) | ||
add_compile_definitions(NO_INLINE_VSNWPRINTF=1) | ||
add_compile_definitions(NO_INLINE_VSWPRINTF=1) | ||
add_compile_definitions(NO_INLINE_SWPRINTF=1) | ||
|
||
# Depending on the phase of the build we are currently running, initialize | ||
# The test system. | ||
if (BUILD_PHASE STREQUAL compile) | ||
# Nothing really to do here ... just need it to check the known values. | ||
elseif (BUILD_PHASE STREQUAL test-compile) | ||
# Initialize the test subsystem as well as the Unity library sources | ||
include(CTest) | ||
|
||
# Add the Unity sources to the build | ||
add_subdirectory(target/dependency/Unity-${UNITY_VERSION}) | ||
else () | ||
# Output an error | ||
message(FATAL_ERROR "Given BUILD_PHASE unknown. Known values are 'compile' and 'test-compile'") | ||
endif () | ||
|
||
set(DEBUG_OUTPUT ON CACHE BOOL "Enable outputting of debug information") | ||
if (DEBUG_OUTPUT) | ||
# Trace all CMAKE Variables | ||
get_cmake_property(_variableNames VARIABLES) | ||
list(SORT _variableNames) | ||
foreach (_variableName ${_variableNames}) | ||
message(STATUS "${_variableName}=${${_variableName}}") | ||
endforeach () | ||
endif () | ||
|
||
#[[ | ||
Build all the modules of TSFILE | ||
]] | ||
# Core stuff | ||
add_subdirectory(common) | ||
add_subdirectory(examples) | ||
add_subdirectory(tsfile) |
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,36 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
~ Licensed to the Apache Software Foundation (ASF) under one | ||
~ or more contributor license agreements. See the NOTICE file | ||
~ distributed with this work for additional information | ||
~ regarding copyright ownership. The ASF licenses this file | ||
~ to you under the Apache License, Version 2.0 (the | ||
~ "License"); you may not use this file except in compliance | ||
~ with the License. You may obtain a copy of the License at | ||
~ | ||
~ http://www.apache.org/licenses/LICENSE-2.0 | ||
~ | ||
~ Unless required by applicable law or agreed to in writing, | ||
~ software distributed under the License is distributed on an | ||
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
~ KIND, either express or implied. See the License for the | ||
~ specific language governing permissions and limitations | ||
~ under the License. | ||
--> | ||
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.2.0 http://maven.apache.org/xsd/assembly-2.2.0.xsd"> | ||
<id>sources</id> | ||
<formats> | ||
<format>zip</format> | ||
</formats> | ||
<fileSets> | ||
<fileSet> | ||
<directory>${basedir}</directory> | ||
<includes> | ||
<include>common/**</include> | ||
<include>examples/**</include> | ||
<include>tsfile/**</include> | ||
<include>CMakeLists.txt</include> | ||
</includes> | ||
</fileSet> | ||
</fileSets> | ||
</assembly> |
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,48 @@ | ||
#[[ | ||
Licensed to the Apache Software Foundation (ASF) under one | ||
or more contributor license agreements. See the NOTICE file | ||
distributed with this work for additional information | ||
regarding copyright ownership. The ASF licenses this file | ||
to you under the Apache License, Version 2.0 (the | ||
"License"); you may not use this file except in compliance | ||
with the License. You may obtain a copy of the License at | ||
https://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, | ||
software distributed under the License is distributed on an | ||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, either express or implied. See the License for the | ||
specific language governing permissions and limitations | ||
under the License. | ||
]] | ||
|
||
add_library(tsfile-common | ||
src/common.cpp | ||
) | ||
|
||
target_include_directories( | ||
tsfile-common | ||
PUBLIC | ||
"include") | ||
|
||
IF (NOT WIN32) | ||
target_link_libraries(tsfile-common | ||
m | ||
) | ||
ELSE() | ||
target_link_libraries(tsfile-common | ||
) | ||
ENDIF() | ||
|
||
if (BUILD_PHASE STREQUAL test-compile) | ||
add_executable(tsfile-common-test | ||
test/common_test.cpp | ||
) | ||
target_link_libraries(tsfile-common-test | ||
tsfile-common | ||
unity | ||
|
||
) | ||
add_test(NAME tsfile-common-test COMMAND tsfile-common-test) | ||
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,30 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
#ifndef TSFILE_COMMON_H | ||
#define TSFILE_COMMON_H | ||
|
||
class Common | ||
{ | ||
public: | ||
Common(); | ||
|
||
int doSomething(int a, int b) const; | ||
}; | ||
|
||
#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,27 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
#include "common.hpp" | ||
|
||
Common::Common() { | ||
// Not really doing anything here ... | ||
} | ||
|
||
int Common::doSomething(int a, int b) const { | ||
return a+b; | ||
} |
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,24 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
#include <cstdio> | ||
|
||
int main() { | ||
printf("Test"); | ||
return 0; | ||
} |
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,50 @@ | ||
#[[ | ||
Licensed to the Apache Software Foundation (ASF) under one | ||
or more contributor license agreements. See the NOTICE file | ||
distributed with this work for additional information | ||
regarding copyright ownership. The ASF licenses this file | ||
to you under the Apache License, Version 2.0 (the | ||
"License"); you may not use this file except in compliance | ||
with the License. You may obtain a copy of the License at | ||
https://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, | ||
software distributed under the License is distributed on an | ||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, either express or implied. See the License for the | ||
specific language governing permissions and limitations | ||
under the License. | ||
]] | ||
|
||
add_library(tsfile-examples | ||
src/example.cpp | ||
) | ||
|
||
target_include_directories( | ||
tsfile-examples | ||
PUBLIC | ||
"include" | ||
"../common/include" | ||
"../tsfile/include") | ||
|
||
IF (NOT WIN32) | ||
target_link_libraries(tsfile-examples | ||
m | ||
) | ||
ELSE() | ||
target_link_libraries(tsfile-examples | ||
) | ||
ENDIF() | ||
|
||
#if (BUILD_PHASE STREQUAL test-compile) | ||
# add_executable(tsfile-examples-test | ||
# test/system_test.c | ||
# ) | ||
# target_link_libraries(tsfile-examples-test | ||
# tsfile-examples | ||
# unity | ||
# | ||
# ) | ||
# add_test(NAME tsfile-examples-test COMMAND tsfile-examples-test) | ||
#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,24 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
#ifndef TSFILE_EXAMPLE_H | ||
#define TSFILE_EXAMPLE_H | ||
|
||
// Not much to do here ... | ||
|
||
#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,29 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
#include <cstdio> | ||
|
||
#include "tsfile.hpp" | ||
|
||
int main() | ||
{ | ||
TsFile* tsFile = new TsFile(); | ||
int result = tsFile->doSomethingElse(10, 20, 3); | ||
printf("Result = %d", result); | ||
return 0; | ||
} |
Oops, something went wrong.