Skip to content

Commit 26792d2

Browse files
authored
Copy BUILD_* directives to the compiler options to allow ifdef in tests
1 parent 55d4d47 commit 26792d2

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

cmake/system.cmake

+12
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,18 @@ set(REVISION "-r${OpenBLAS_VERSION}")
393393
set(MAJOR_VERSION ${OpenBLAS_MAJOR_VERSION})
394394

395395
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CCOMMON_OPT}")
396+
if (BUILD_SINGLE)
397+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DBUILD_SINGLE")
398+
endif()
399+
if (BUILD_DOUBLE)
400+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DBUILD_DOUBLE")
401+
endif()
402+
if (BUILD_COMPLEX)
403+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DBUILD_COMPLEX")
404+
endif()
405+
if (BUILD_COMPLEX16)
406+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DBUILD_COMPLEX16")
407+
endif()
396408
if(NOT MSVC)
397409
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} ${CCOMMON_OPT}")
398410
endif()

0 commit comments

Comments
 (0)