Skip to content
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

Added C++ compilation #939

Merged
merged 2 commits into from
Nov 22, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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))