-
Notifications
You must be signed in to change notification settings - Fork 52
Meson #108
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
isovic
wants to merge
14
commits into
master
Choose a base branch
from
meson
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Meson #108
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
fd2376f
Added the Meson build support to Racon. Also, a very simple Makefile …
isovic 18e53aa
Updated the Makefile with a rule to run the CMake build (cmake), and …
isovic 48f3378
Updated the CMakeLists.txt to configure the version.hpp.in file.
isovic 6f83c67
The version is no longer stored in the src/main.cpp. Instead, it's co…
isovic ca83e2e
Updated the README.md.
isovic 17b3342
Version bump to v1.3.4.
isovic bddef92
meson 0.48 is ok
fc2a901
added rule -- rebuild
b0a47c2
Updated the Makefile. Git modules are now fetched automatically.
isovic d744d4a
install racon executable
ca6208e
Updated the meson.build and test/meson.build. Working on building the…
isovic 8cb30c0
Updated the includes in test/racon_test.cpp.
isovic f1b36d6
Updated the meson.build files to build the tests properly.
isovic 9865510
The 'make cmake' rule now builds the tests too.
isovic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
| @@ -1,2 +1,5 @@ | ||
| # Compiled Object files | ||
| build | ||
| subprojects | ||
| !subprojects/*.wrap | ||
|
|
This file contains hidden or 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 hidden or 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 @@ | ||
| .PHONY: all clean meson cmake debug dist modules | ||
|
|
||
| all: meson | ||
|
|
||
| clean: | ||
| rm -rf build build-meson | ||
|
|
||
| meson: modules | ||
| @echo "[Invoking Meson]" | ||
| @mkdir -p build-meson && cd build-meson && meson --buildtype=release -Dc_args=-O3 && ninja | ||
|
|
||
| rebuild: modules | ||
| @echo "[Running Ninja only]" | ||
| @ninja -C build-meson | ||
|
|
||
| cmake: modules | ||
| @echo "[Invoking CMake]" | ||
| @mkdir -p build && cd build && cmake -DCMAKE_BUILD_TYPE=Release -Dracon_build_tests=ON .. && make | ||
|
|
||
| debug: modules | ||
| @echo "[Invoking Meson]" | ||
| @mkdir -p build-debug && cd build-debug && (meson --buildtype=debugoptimized -Db_sanitize=address) && ninja | ||
|
|
||
| dist: release | ||
| cd build && ninja-dist | ||
|
|
||
| modules: | ||
| @echo "[Fetching submodules]" | ||
| @git submodule update --init |
This file contains hidden or 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 hidden or 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,118 @@ | ||
| project( | ||
| 'Racon', | ||
| 'cpp', | ||
| version : '1.3.4', | ||
| default_options : [ | ||
| 'buildtype=release', | ||
| 'warning_level=3', | ||
| 'cpp_std=c++11'], | ||
| license : 'MIT', | ||
| meson_version : '>= 0.48') | ||
|
|
||
| cpp = meson.get_compiler('cpp') | ||
|
|
||
| ############ | ||
| # CXXFLAGS # | ||
| ############ | ||
|
|
||
| racon_warning_flags = [] | ||
| racon_cpp_flags = [] | ||
|
|
||
| ################ | ||
| # Dependencies # | ||
| ################ | ||
|
|
||
| # Threads. | ||
| racon_thread_dep = dependency('threads', required : true) | ||
|
|
||
| # Zlib. | ||
| racon_zlib_dep = dependency('zlib', required: true, version : '>= 1.2.11', fallback : ['zlib', 'zlib_dep']) | ||
|
|
||
| # Google test. | ||
| gtest_dep = dependency('gtest', main : true, required : false) | ||
| if not gtest_dep.found() | ||
| gtest_proj = subproject('gtest') | ||
| gtest_inc = gtest_proj.get_variable('gtest_incdir') | ||
| gtest_lib = static_library('gtest', gtest_proj.get_variable('gtest_libsources'), | ||
| gtest_proj.get_variable('gtest_mainsources'), | ||
| include_directories : gtest_inc) | ||
|
|
||
| gtest_dep = declare_dependency(include_directories : gtest_inc, | ||
| link_with : gtest_lib, dependencies: racon_thread_dep) | ||
| endif | ||
|
|
||
| ####################### | ||
| # Configuring headers # | ||
| ####################### | ||
| racon_version_commit = 'unknown' | ||
| git_command = find_program('git', required: false) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. have you tried |
||
| if git_command.found() | ||
| git_run = run_command('git', ['log', '-1', '--pretty=%h']) | ||
| if git_run.returncode() == 0 | ||
| racon_version_commit = git_run.stdout().strip() | ||
| endif | ||
| endif | ||
|
|
||
| racon_version_h_config = configuration_data() | ||
| racon_version = meson.project_version() | ||
| racon_version_split = meson.project_version().split('.') | ||
| racon_version_h_config.set('RACON_VERSION_MAJOR', racon_version_split[0]) | ||
| racon_version_h_config.set('RACON_VERSION_MINOR', racon_version_split[1]) | ||
| racon_version_h_config.set('RACON_VERSION_PATCH', racon_version_split[2]) | ||
| racon_version_h_config.set('RACON_VERSION_COMMIT', racon_version_commit) | ||
|
|
||
| racon_version_h = configure_file( | ||
| input : files('src/version.hpp.in'), | ||
| output : 'version.hpp', | ||
| configuration : racon_version_h_config) | ||
|
|
||
| ########### | ||
| # Headers # | ||
| ########### | ||
|
|
||
| racon_include_directories = [include_directories('src'), include_directories('test')] | ||
|
|
||
| ###################### | ||
| # Sources + codebase # | ||
| ###################### | ||
|
|
||
| subdir('vendor') | ||
| subdir('src') | ||
| subdir('test') | ||
|
|
||
| all_sources = racon_cpp_sources + vendor_cpp_sources | ||
|
|
||
| ###################### | ||
| # The Racon exe. # | ||
| ###################### | ||
|
|
||
| racon_dep = declare_dependency( | ||
| include_directories: vendor_include_directories + racon_include_directories, | ||
| link_with: [racon_lib, vendor_lib], | ||
| dependencies: [racon_thread_dep, racon_zlib_dep], | ||
| version: meson.project_version(), | ||
| compile_args: racon_warning_flags + racon_cpp_flags) | ||
|
|
||
| if not meson.is_subproject() | ||
| racon_bin = executable( | ||
| 'racon', | ||
| ['src/main.cpp'], | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| install : true, | ||
| dependencies : [racon_thread_dep, racon_zlib_dep], | ||
| include_directories : vendor_include_directories + racon_include_directories, | ||
| link_with : [racon_lib], | ||
| cpp_args : [racon_warning_flags, racon_cpp_flags]) | ||
|
|
||
| ###################### | ||
| # Tests # | ||
| ###################### | ||
| if gtest_dep.found() | ||
| tests_bin = executable( | ||
| 'racon_test', | ||
| racon_test_cpp_sources, | ||
| dependencies : [racon_thread_dep, racon_zlib_dep, gtest_dep], | ||
| include_directories : racon_include_directories + vendor_include_directories + racon_test_include_directories, | ||
| link_with : [racon_lib, vendor_lib], | ||
| cpp_args : [racon_warning_flags, racon_cpp_flags, racon_test_extra_flags]) | ||
| endif | ||
| endif | ||
This file contains hidden or 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 hidden or 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 @@ | ||
| racon_cpp_sources = files([ | ||
| 'overlap.cpp', | ||
| 'polisher.cpp', | ||
| 'sequence.cpp', | ||
| 'window.cpp' | ||
| ]) | ||
|
|
||
| racon_extra_flags = [] | ||
|
|
||
| racon_lib_install = (not meson.is_subproject()) or (get_option('default_library') == 'shared') | ||
|
|
||
| racon_lib = library( | ||
| 'racon', | ||
| racon_cpp_sources, | ||
| soversion : 0, | ||
| version : meson.project_version(), | ||
| install : racon_lib_install, | ||
| link_with : vendor_lib, | ||
| dependencies : [racon_thread_dep, racon_zlib_dep], | ||
| include_directories : racon_include_directories + vendor_include_directories, | ||
| cpp_args : [racon_extra_flags, racon_warning_flags, racon_cpp_flags]) |
This file contains hidden or 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,22 @@ | ||
| /*! | ||
| * @file version.hpp | ||
| * | ||
| * @brief Version information for the entire project. | ||
| */ | ||
|
|
||
| #pragma once | ||
|
|
||
| #include <string> | ||
|
|
||
| static const int32_t RACON_VERSION_MAJOR = @RACON_VERSION_MAJOR@; | ||
| static const int32_t RACON_VERSION_MINOR = @RACON_VERSION_MINOR@; | ||
| static const int32_t RACON_VERSION_PATCH = @RACON_VERSION_PATCH@; | ||
| static const std::string RACON_VERSION_COMMIT("@RACON_VERSION_COMMIT@"); | ||
|
|
||
| static const std::string RACON_VERSION_STRING = | ||
| std::to_string(RACON_VERSION_MAJOR) + "." + | ||
| std::to_string(RACON_VERSION_MINOR) + "." + | ||
| std::to_string(RACON_VERSION_PATCH) + "-" + | ||
| RACON_VERSION_COMMIT; | ||
|
|
||
| static const std::string COMPILE_DATE = (std::string(__DATE__) + std::string(" at ") + std::string(__TIME__)); |
This file contains hidden or 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,10 @@ | ||
| [wrap-file] | ||
| directory = googletest-release-1.8.0 | ||
|
|
||
| source_url = https://github.com/google/googletest/archive/release-1.8.0.zip | ||
| source_filename = gtest-1.8.0.zip | ||
| source_hash = f3ed3b58511efd272eb074a3a6d6fb79d7c2e6a0e374323d1e6bcbcc1ef141bf | ||
|
|
||
| patch_url = https://wrapdb.mesonbuild.com/v1/projects/gtest/1.8.0/5/get_zip | ||
| patch_filename = gtest-1.8.0-5-wrap.zip | ||
| patch_hash = 7eeaede4aa2610a403313b74e04baf91ccfbaef03203d8f56312e22df1834ec5 |
This file contains hidden or 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,10 @@ | ||
| [wrap-file] | ||
| directory = zlib-1.2.11 | ||
|
|
||
| source_url = http://zlib.net/fossils/zlib-1.2.11.tar.gz | ||
| source_filename = zlib-1.2.11.tar.gz | ||
| source_hash = c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1 | ||
|
|
||
| patch_url = https://wrapdb.mesonbuild.com/v1/projects/zlib/1.2.11/3/get_zip | ||
| patch_filename = zlib-1.2.11-3-wrap.zip | ||
| patch_hash = f07dc491ab3d05daf00632a0591e2ae61b470615b5b73bcf9b3f061fff65cff0 |
This file contains hidden or 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,14 @@ | ||
| racon_test_cpp_sources = files([ | ||
| 'racon_test.cpp' | ||
| ]) | ||
|
|
||
| racon_test_include_directories = [include_directories('.')] | ||
|
|
||
| racon_test_extra_flags = [] | ||
|
|
||
| racon_test_config_h_vars = configuration_data() | ||
| racon_test_config_h_vars.set('racon_test_data_path', meson.source_root() + '/test/data/') | ||
| racon_test_config_h = configure_file( | ||
| input : files('racon_test_config.h.in'), | ||
| output : 'racon_test_config.h', | ||
| configuration : racon_test_config_h_vars) |
This file contains hidden or 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 hidden or 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,35 @@ | ||
| vendor_cpp_sources = files([ | ||
| 'edlib/edlib/src/edlib.cpp', | ||
| 'rampler/src/sampler.cpp', | ||
| 'rampler/src/sequence.cpp', | ||
| 'spoa/src/alignment_engine.cpp', | ||
| 'spoa/src/graph.cpp', | ||
| 'spoa/src/sequence.cpp', | ||
| 'spoa/src/simd_alignment_engine.cpp', | ||
| 'spoa/src/sisd_alignment_engine.cpp', | ||
| 'thread_pool/src/thread_pool.cpp' | ||
| ]) | ||
|
|
||
| vendor_include_directories = [ | ||
| include_directories('bioparser/include'), | ||
| include_directories('edlib/edlib/include'), | ||
| include_directories('logger/include'), | ||
| include_directories('rampler/src'), | ||
| include_directories('spoa/include'), | ||
| include_directories('thread_pool/include') | ||
| ] | ||
|
|
||
| vendor_extra_flags = [] | ||
|
|
||
| vendor_lib_install = (not meson.is_subproject()) or (get_option('default_library') == 'shared') | ||
|
|
||
| vendor_lib = library( | ||
| 'vendor', | ||
| vendor_cpp_sources, | ||
| soversion : 0, | ||
| version : meson.project_version(), | ||
| install : vendor_lib_install, | ||
| link_with : [], | ||
| dependencies : [racon_thread_dep, racon_zlib_dep], | ||
| include_directories : vendor_include_directories, | ||
| cpp_args : [vendor_extra_flags, racon_warning_flags, racon_cpp_flags]) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Meson supports has a GTest wrapDB?