mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-30 11:13:57 +00:00
Merge pull request #2342 from philip-wernersbach/more-improved-objc
Fix linking errors with basic Objective-C FFI.
This commit is contained in:
@@ -363,7 +363,16 @@ proc nameToCC*(name: string): TSystemCC =
|
|||||||
proc getConfigVar(c: TSystemCC, suffix: string): string =
|
proc getConfigVar(c: TSystemCC, suffix: string): string =
|
||||||
# use ``cpu.os.cc`` for cross compilation, unless ``--compileOnly`` is given
|
# use ``cpu.os.cc`` for cross compilation, unless ``--compileOnly`` is given
|
||||||
# for niminst support
|
# for niminst support
|
||||||
let fullSuffix = (if gCmd == cmdCompileToCpp: ".cpp" & suffix else: suffix)
|
let fullSuffix =
|
||||||
|
if gCmd == cmdCompileToCpp:
|
||||||
|
".cpp" & suffix
|
||||||
|
elif gCmd == cmdCompileToOC:
|
||||||
|
".objc" & suffix
|
||||||
|
elif gCmd == cmdCompileToJS:
|
||||||
|
".js" & suffix
|
||||||
|
else:
|
||||||
|
suffix
|
||||||
|
|
||||||
if (platform.hostOS != targetOS or platform.hostCPU != targetCPU) and
|
if (platform.hostOS != targetOS or platform.hostCPU != targetCPU) and
|
||||||
optCompileOnly notin gGlobalOptions:
|
optCompileOnly notin gGlobalOptions:
|
||||||
let fullCCname = platform.CPU[targetCPU].name & '.' &
|
let fullCCname = platform.CPU[targetCPU].name & '.' &
|
||||||
|
|||||||
@@ -112,6 +112,22 @@ path="$lib/pure/unidecode"
|
|||||||
gcc.cpp.options.always = "-w -fpermissive"
|
gcc.cpp.options.always = "-w -fpermissive"
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
# Configuration for Objective-C compiler:
|
||||||
|
#
|
||||||
|
# Options for GNUStep. GNUStep configuration varies wildly, so you'll probably
|
||||||
|
# have to add additional compiler and linker flags on a per-project basis.
|
||||||
|
gcc.objc.options.linker = "-lobjc -lgnustep-base"
|
||||||
|
llvm_gcc.objc.options.linker = "-lobjc -lgnustep-base"
|
||||||
|
clang.objc.options.linker = "-lobjc -lgnustep-base"
|
||||||
|
|
||||||
|
# Options for Mac OS X. Mac OS X uses its own Objective-C stack that is
|
||||||
|
# totally different from GNUStep.
|
||||||
|
@if macosx:
|
||||||
|
gcc.objc.options.linker = "-framework Foundation"
|
||||||
|
llvm_gcc.objc.options.linker = "-framework Foundation"
|
||||||
|
clang.objc.options.linker = "-framework Foundation"
|
||||||
|
@end
|
||||||
|
|
||||||
# Configuration for the VxWorks
|
# Configuration for the VxWorks
|
||||||
# This has been tested with VxWorks 6.9 only
|
# This has been tested with VxWorks 6.9 only
|
||||||
@if vxworks:
|
@if vxworks:
|
||||||
|
|||||||
Reference in New Issue
Block a user