@@ -14,11 +14,13 @@ set(CMAKE_ISPC_FLAGS "${CMAKE_ISPC_FLAGS} --pic")
1414# =============================================================================
1515# NMODL CLI options : common and backend specific
1616# =============================================================================
17+ # ~~~
1718# if user pass arguments then use those as common arguments
1819# note that inlining is done by default
20+ # ~~~
1921set (NMODL_COMMON_ARGS "passes --inline" )
2022
21- if (NOT "${CORENRN_NMODL_FLAGS} " STREQUAL "" )
23+ if (NOT "${CORENRN_NMODL_FLAGS} " STREQUAL "" )
2224 set (NMODL_COMMON_ARGS "${NMODL_COMMON_ARGS} ${CORENRN_NMODL_FLAGS} " )
2325endif ()
2426
@@ -31,10 +33,10 @@ set(NMODL_ACC_BACKEND_ARGS "host --c acc --oacc")
3133# =============================================================================
3234get_directory_property (COMPILE_DEFS COMPILE_DEFINITIONS )
3335if (COMPILE_DEFS)
34- set (CORENRN_COMMON_COMPILE_DEFS "" )
35- foreach (flag ${COMPILE_DEFS} )
36- set (CORENRN_COMMON_COMPILE_DEFS "${CORENRN_COMMON_COMPILE_DEFS} -D${flag} " )
37- endforeach ()
36+ set (CORENRN_COMMON_COMPILE_DEFS "" )
37+ foreach (flag ${COMPILE_DEFS} )
38+ set (CORENRN_COMMON_COMPILE_DEFS "${CORENRN_COMMON_COMPILE_DEFS} -D${flag} " )
39+ endforeach ()
3840endif ()
3941
4042# =============================================================================
@@ -48,20 +50,20 @@ list(REMOVE_ITEM CORENRN_LINK_LIBS "Threads::Threads")
4850
4951# replicate CMake magic to transform system libs to -l<libname>
5052foreach (link_lib ${CORENRN_LINK_LIBS} )
51- if (${link_lib} MATCHES "\- l.*" )
52- string (APPEND CORENRN_COMMON_LDFLAGS " ${link_lib} " )
53- continue ()
54- endif ()
55- get_filename_component (path ${link_lib} DIRECTORY )
56- if (NOT path )
57- string (APPEND CORENRN_COMMON_LDFLAGS " -l${link_lib} " )
58- elseif ("${path} " MATCHES "^(/lib|/lib64|/usr/lib|/usr/lib64)$" )
59- get_filename_component (libname ${link_lib} NAME_WE )
60- string (REGEX REPLACE "^lib" "" libname ${libname} )
61- string (APPEND CORENRN_COMMON_LDFLAGS " -l${libname} " )
62- else ()
63- string (APPEND CORENRN_COMMON_LDFLAGS " ${link_lib} " )
64- endif ()
53+ if (${link_lib} MATCHES "\- l.*" )
54+ string (APPEND CORENRN_COMMON_LDFLAGS " ${link_lib} " )
55+ continue ()
56+ endif ()
57+ get_filename_component (path ${link_lib} DIRECTORY )
58+ if (NOT path )
59+ string (APPEND CORENRN_COMMON_LDFLAGS " -l${link_lib} " )
60+ elseif ("${path} " MATCHES "^(/lib|/lib64|/usr/lib|/usr/lib64)$" )
61+ get_filename_component (libname ${link_lib} NAME_WE )
62+ string (REGEX REPLACE "^lib" "" libname ${libname} )
63+ string (APPEND CORENRN_COMMON_LDFLAGS " -l${libname} " )
64+ else ()
65+ string (APPEND CORENRN_COMMON_LDFLAGS " ${link_lib} " )
66+ endif ()
6567endforeach ()
6668
6769# =============================================================================
0 commit comments