Skip to content

Commit 9cc7326

Browse files
committed
source code to src
1 parent 23ab586 commit 9cc7326

File tree

9 files changed

+17
-15
lines changed

9 files changed

+17
-15
lines changed

CMakeLists.txt

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,9 @@ endif()
1313

1414
include(cmake/compilers.cmake)
1515

16-
add_library(game mm_game.f90 random.f90)
17-
target_link_libraries(game PRIVATE ${FLIBS})
18-
if(f18random)
19-
target_sources(game PRIVATE rand2018.f90)
20-
else()
21-
target_sources(game PRIVATE rand2003.f90)
22-
endif()
16+
add_subdirectory(src)
2317

24-
add_executable(mastermind mastermind.f90)
18+
add_executable(mastermind src/mastermind.f90)
2519
target_link_libraries(mastermind game ${FLIBS})
2620

2721
add_executable(compare_test tests/test_compare.f90)

meson.build

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,9 @@ elif fcid == 'pgi'
1010
add_global_arguments('-C', '-Mdclchk', language: 'fortran')
1111
endif
1212

13-
if fc.links('call random_init(.false., .false.); end')
14-
rsrc = 'rand2018.f90'
15-
else
16-
rsrc = 'rand2003.f90'
17-
endif
18-
game_lib = static_library('game', ['mm_game.f90', 'random.f90', rsrc])
13+
subdir('src')
1914

20-
executable('mastermind', 'mastermind.f90',
15+
executable('mastermind', 'src/mastermind.f90',
2116
link_with : game_lib,
2217
install : true)
2318

src/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
add_library(game mm_game.f90 random.f90)
2+
target_link_libraries(game PRIVATE ${FLIBS})
3+
if(f18random)
4+
target_sources(game PRIVATE rand2018.f90)
5+
else()
6+
target_sources(game PRIVATE rand2003.f90)
7+
endif()
File renamed without changes.

src/meson.build

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
if fc.links('call random_init(.false., .false.); end')
2+
rsrc = 'rand2018.f90'
3+
else
4+
rsrc = 'rand2003.f90'
5+
endif
6+
game_lib = static_library('game', ['mm_game.f90', 'random.f90', rsrc])
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)