Skip to content

Commit

Permalink
Added C++ compilation (algorithm-archivists#939)
Browse files Browse the repository at this point in the history
  • Loading branch information
Amaras authored Nov 22, 2021
1 parent 866581e commit 465e1e8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
5 changes: 4 additions & 1 deletion SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,15 @@ env['CC'] = 'gcc'
for tool in ['gcc','gnulink']:
env.Tool(tool)
env['CCFLAGS'] = ''
env['CXXFLAGS'] = '-std=c++17'

# Add other languages here when you want to add language targets
# Put 'name_of_language_directory' : 'file_extension'
languages = {'c': 'c'}
languages = {'c': 'c', 'cpp': 'cpp'}

env.C = env.Program
env.CPlusPlus = env.Program


Export('env')

Expand Down
6 changes: 6 additions & 0 deletions contents/split-operator_method/code/cpp/SConscript
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Import('*')
from pathlib import Path

dirname = Path.cwd().parents[1].stem

env.CPlusPlus(f'#/build/cpp/{dirname}', Glob('*.cpp'), LIBS=['m', 'fftw3'])
6 changes: 6 additions & 0 deletions sconscripts/cpp_SConscript
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Import('files_to_compile env')
from pathlib import Path

for file in files_to_compile:
chapter_name = file.parent.parent.parent.stem
env.CPlusPlus(f'#/build/cpp/{chapter_name}', str(file))

0 comments on commit 465e1e8

Please sign in to comment.