File tree Expand file tree Collapse file tree 4 files changed +36
-6
lines changed Expand file tree Collapse file tree 4 files changed +36
-6
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,17 @@ if( ${TARGET_OS} STREQUAL "Linux" )
4949 message ("Unsupported architecture: ${TARGET_ARCHITECTURE} " )
5050 return ()
5151 endif ()
52+ elseif ( ${TARGET_OS} STREQUAL "Darwin" )
53+ set (OS "OSX" )
54+ set (OSNAME "Darwin" )
55+ if ( ${TARGET_ARCHITECTURE} STREQUAL "x86_64" )
56+ set (ARCHNAME x86-64)
57+ set (ARCH X86)
58+ set (WRDSZ 64)
59+ else ()
60+ message ("Unsupported architecture: ${TARGET_ARCHITECTURE} " )
61+ return ()
62+ endif ()
5263else ()
5364 message ("Unsupported OS: ${TARGET_OS} " )
5465 return ()
Original file line number Diff line number Diff line change 1616
1717set (RUNTIME_SHARED_DIR ${CMAKE_CURRENT_SOURCE_DIR} /shared)
1818
19+ if ( ${TARGET_OS} STREQUAL "Darwin" )
20+ add_definitions (
21+ -DTARGET_OSX
22+ -DTARGET_OSX_X8664
23+ -DOSX86
24+ )
25+ else ()
26+ add_definitions (
27+ -DTARGET_LINUX
28+ -DLINUX
29+ )
30+ endif ()
31+
1932add_definitions (
2033 -DMAXCPUS=256
2134 -DMAXCPUSL=8
2235 -DMAXCPUSR=8
23- -DTARGET_LINUX
2436 -DTARGET_LLVM
25- -DLINUX
2637 -DPGF90
2738 -DPGFLANG
2839 -DNATIVE_FPCVT
Original file line number Diff line number Diff line change @@ -477,9 +477,16 @@ add_flang_library(flang_shared
477477 ${SHARED_SOURCES}
478478 )
479479set_property (TARGET flang_shared PROPERTY OUTPUT_NAME flang)
480- target_link_libraries (flang_shared ${CMAKE_BINARY_DIR} /${CMAKE_CFG_INTDIR} /lib/libflangrti.so)
481- # Resolve symbols against libm and librt
482- target_link_libraries (flang_shared m rt)
480+
481+
482+ if ( ${TARGET_OS} STREQUAL "Darwin" )
483+ target_link_libraries (flang_shared ${CMAKE_BINARY_DIR} /${CMAKE_CFG_INTDIR} /lib/libflangrti.dylib)
484+ target_link_libraries (flang_shared m pgmath omp)
485+ else ()
486+ target_link_libraries (flang_shared ${CMAKE_BINARY_DIR} /${CMAKE_CFG_INTDIR} /lib/libflangrti.so)
487+ # Resolve symbols against libm and librt
488+ target_link_libraries (flang_shared m rt)
489+ endif ()
483490
484491set (SHARED_LIBRARY FALSE )
485492
Original file line number Diff line number Diff line change @@ -33,7 +33,8 @@ set(FLANG2_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/include)
3333
3434include_directories (${FLANG2_INCLUDE_DIR} )
3535
36- if ( ${TARGET_OS} STREQUAL "Linux" )
36+ # this is a hack until there is a proper setup
37+ if ( ${TARGET_OS} STREQUAL "Linux|Darwin" )
3738 if ( ${TARGET_ARCHITECTURE} STREQUAL "x86_64" )
3839 set (X86_64 ON )
3940 set (LINUX86 ON )
You can’t perform that action at this time.
0 commit comments