Skip to content

Commit 3412409

Browse files
committed
Addition of macros.inc
2 parents 75d904c + 4f279e6 commit 3412409

File tree

14 files changed

+25
-11
lines changed

14 files changed

+25
-11
lines changed

.github/workflows/ci_modular.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
-DCMAKE_MAXIMUM_RANK:String=4
5656
-DCMAKE_INSTALL_PREFIX=$PWD/_dist
5757
-DFIND_BLAS:STRING=FALSE
58-
-DSTDLIB_WITH_BITSET:STRING=${{ matrix.with_bitset }}
58+
-DSTDLIB_NO_BITSET:STRING=${{ matrix.with_bitset }}
5959
-S . -B ${{ env.BUILD_DIR }}
6060
6161
- name: Build and compile

CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,11 @@ if(NOT DEFINED CMAKE_MAXIMUM_RANK)
4949
set(CMAKE_MAXIMUM_RANK 4 CACHE STRING "Maximum array rank for generated procedures")
5050
endif()
5151

52+
option(STDLIB_NO_BITSET "Does not compile STDLIB BITSET" OFF)
5253

53-
option(STDLIB_WITH_BITSET "Compile STDLIB BITSET" ON)
54-
55-
if(STDLIB_WITH_BITSET)
56-
message(STATUS "Enable stdlib bitset module")
57-
add_compile_definitions(STDLIB_BITSET)
54+
if(STDLIB_NO_BITSET)
55+
message(STATUS "Disable stdlib bitset module")
56+
add_compile_definitions(STDLIB_NO_BITSET)
5857
endif()
5958

6059
option(FIND_BLAS "Find external BLAS and LAPACK" ON)
@@ -136,6 +135,7 @@ list(
136135
"-I${PROJECT_SOURCE_DIR}/include"
137136
)
138137

138+
include_directories(${PROJECT_SOURCE_DIR}/include)
139139
add_subdirectory(src)
140140

141141
if(BUILD_TESTING)

example/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ endmacro(ADD_EXAMPLEPP)
1919
add_subdirectory(ansi)
2020
add_subdirectory(array)
2121
add_subdirectory(ascii)
22-
if (STDLIB_WITH_BITSET)
22+
if (NOT STDLIB_NO_BITSET)
2323
add_subdirectory(bitsets)
2424
endif()
2525
add_subdirectory(constants)

example/math/example_math_swap.F90

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#include 'macros.inc'
12
program example_math_swap
23
use stdlib_math, only: swap
34
implicit none

example/sorting/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ ADD_EXAMPLE(sort)
33
ADD_EXAMPLE(sort_adjoint)
44
ADD_EXAMPLE(sort_index)
55
ADD_EXAMPLE(radix_sort)
6-
if (STDLIB_WITH_BITSET)
6+
if (NOT STDLIB_NO_BITSET)
77
ADD_EXAMPLE(sort_bitset)
88
endif()

include/macros.inc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
!Default: compile the bitset module
3+
#define STDLIB_BITSET
4+
5+
#ifdef STDLIB_NO_BITSET
6+
#undef STDLIB_BITSET
7+
#endif

src/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
if (STDLIB_WITH_BITSET)
1+
if (NOT STDLIB_NO_BITSET)
22
add_subdirectory(bitsets)
33
endif()
44
add_subdirectory(blas)
@@ -123,5 +123,5 @@ set(f90Files
123123
configure_stdlib_target(${PROJECT_NAME} f90Files fppFiles cppFiles)
124124

125125
target_link_libraries(${PROJECT_NAME} PUBLIC
126-
$<$<BOOL:${STDLIB_WITH_BITSET}>:bitsets>
126+
$<$<NOT:$<BOOL:${STDLIB_NO_BITSET}>>:bitsets>
127127
blas lapack)

src/stdlib_math.fypp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#include 'macros.inc'
12
#:include "common.fypp"
23
#:set IR_KINDS_TYPES = INT_KINDS_TYPES + REAL_KINDS_TYPES
34
#:set RC_KINDS_TYPES = REAL_KINDS_TYPES + CMPLX_KINDS_TYPES

src/stdlib_sorting.fypp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#include 'macros.inc'
12
#:include "common.fypp"
23

34
#:set INT_TYPES_ALT_NAME = list(zip(INT_TYPES, INT_TYPES, INT_KINDS, INT_CPPS))

src/stdlib_sorting_ord_sort.fypp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#include 'macros.inc'
12
#:include "common.fypp"
23
#:set INT_TYPES_ALT_NAME = list(zip(INT_TYPES, INT_TYPES, INT_TYPES, INT_KINDS, INT_CPPS))
34
#:set REAL_TYPES_ALT_NAME = list(zip(REAL_TYPES, REAL_TYPES, REAL_TYPES, REAL_KINDS, REAL_CPPS))

0 commit comments

Comments
 (0)