Skip to content

Commit 8fbe250

Browse files
committed
[MISC] create multiple translation units [step1]
1 parent c241387 commit 8fbe250

8 files changed

Lines changed: 14 additions & 26 deletions

File tree

src/CMakeLists.txt

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -191,22 +191,7 @@ set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
191191
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SEQAN_CXX_FLAGS} -Wall -pedantic")
192192

193193
# Update the list of file names below if you add source files to your application.
194-
set (LAMBDA_SOURCE_FILES
195-
lambda.cpp
196-
shared_definitions.hpp
197-
shared_misc.hpp
198-
shared_options.hpp
199-
search.hpp
200-
search_algo.hpp
201-
search_datastructures.hpp
202-
search_misc.hpp
203-
search_output.hpp
204-
search_options.hpp
205-
mkindex.hpp
206-
mkindex_algo.hpp
207-
mkindex_misc.hpp
208-
mkindex_options.hpp
209-
mkindex_saca.hpp)
194+
set (LAMBDA_SOURCE_FILES lambda.cpp search.cpp mkindex.cpp)
210195

211196
add_executable (lambda3 ${LAMBDA_SOURCE_FILES})
212197
target_link_libraries (lambda3 ${SEQAN_LIBRARIES} seqan3::seqan3)

src/lambda.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
#include "search.hpp"
2727
#include "mkindex.hpp"
28-
// using namespace seqan;
28+
#include "shared_options.hpp"
2929

3030
void parseCommandLineMain(int argc, char const ** argv);
3131

src/mkindex.hpp renamed to src/mkindex.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
// lambda.cpp: Main File for the main application
2020
// ==========================================================================
2121

22+
#include "seqan2seqan3.hpp" // must come first
23+
2224
#include <initializer_list>
2325
#include <iostream>
2426

@@ -37,8 +39,6 @@
3739
// #include "mkindex_saca.hpp"
3840
#include "mkindex_algo.hpp"
3941

40-
// using namespace seqan;
41-
4242
// ==========================================================================
4343
// Forwards
4444
// ==========================================================================

src/mkindex_options.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
#include <unistd.h>
2626
#include <bitset>
2727

28+
#include <seqan3/argument_parser/all.hpp>
29+
2830
// --------------------------------------------------------------------------
2931
// Class LambdaIndexerOptions
3032
// --------------------------------------------------------------------------

src/search.hpp renamed to src/search.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
// lambda.cpp: Main File for Lambda
2020
// ==========================================================================
2121

22-
#pragma once
22+
#include "seqan2seqan3.hpp" // must come first
2323

2424
#include <iostream>
2525

src/search_options.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
#include <seqan/index.h>
3232
#include <seqan/blast.h>
3333

34+
#include <seqan3/argument_parser/all.hpp>
3435
#include <seqan3/std/filesystem>
3536

36-
3737
// ==========================================================================
3838
// Forwards
3939
// ==========================================================================

src/shared_misc.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ constexpr bool all_valid(TRange && r)
121121
return true;
122122
}
123123

124-
AlphabetEnum detectSeqFileAlphabet(std::string const & path)
124+
inline AlphabetEnum detectSeqFileAlphabet(std::string const & path)
125125
{
126126
seqan3::sequence_file_input<alphabet_detection_traits, seqan3::fields<seqan3::field::seq>> f{path};
127127

@@ -387,7 +387,7 @@ inline double sysTime()
387387
// Function fileSize()
388388
// ----------------------------------------------------------------------------
389389

390-
uint64_t fileSize(char const * fileName)
390+
inline uint64_t fileSize(char const * fileName)
391391
{
392392
struct stat st;
393393
if (stat(fileName, &st) != 0)
@@ -399,7 +399,7 @@ uint64_t fileSize(char const * fileName)
399399
// Function dirSize()
400400
// ----------------------------------------------------------------------------
401401

402-
uint64_t dirSize(char const * dirName)
402+
inline uint64_t dirSize(char const * dirName)
403403
{
404404
DIR *d;
405405
struct dirent *de;
@@ -434,7 +434,7 @@ uint64_t dirSize(char const * dirName)
434434
// Function fileSize()
435435
// ----------------------------------------------------------------------------
436436

437-
uint64_t getTotalSystemMemory()
437+
inline uint64_t getTotalSystemMemory()
438438
{
439439
#if defined(__APPLE__)
440440
uint64_t mem;

src/shared_options.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include <seqan3/alphabet/aminoacid/aa10murphy.hpp>
3333
#include <seqan3/alphabet/aminoacid/aa10li.hpp>
3434
#include <seqan3/alphabet/aminoacid/translation_genetic_code.hpp>
35+
#include <seqan3/argument_parser/all.hpp>
3536
#include <seqan3/std/filesystem>
3637

3738
// #include <seqan/basic.h>
@@ -291,7 +292,7 @@ struct SharedOptions
291292
// Function sharedSetup()
292293
// --------------------------------------------------------------------------
293294

294-
void sharedSetup(seqan3::argument_parser & parser)
295+
inline void sharedSetup(seqan3::argument_parser & parser)
295296
{
296297
// Set short description, version, and date
297298
parser.info.version = SEQAN_APP_VERSION;

0 commit comments

Comments
 (0)