mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-19 04:31:17 +00:00
[CMake] Let llvm_add_library(MODULE) check capability of loadable module.
On unsupported platforms, llvm_add_library(MODULE) doesn't create any targets. Caller may be responsible to check and add extra target properties. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201320 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
069bd29ec4
commit
621c80f4d7
@ -163,9 +163,12 @@ function(set_output_directory target bindir libdir)
|
||||
endfunction()
|
||||
|
||||
# llvm_add_library(name sources...
|
||||
# MODULE;SHARED;STATIC
|
||||
# SHARED;STATIC
|
||||
# STATIC by default w/o BUILD_SHARED_LIBS.
|
||||
# SHARED by default w/ BUILD_SHARED_LIBS.
|
||||
# MODULE
|
||||
# Target ${name} might not be created on unsupported platforms.
|
||||
# Check with "if(TARGET ${name})".
|
||||
# OUTPUT_NAME name
|
||||
# Corresponds to OUTPUT_NAME in target properties.
|
||||
# DEPENDS targets...
|
||||
@ -194,6 +197,10 @@ function(llvm_add_library name)
|
||||
if(ARG_SHARED OR ARG_STATIC)
|
||||
message(WARNING "MODULE with SHARED|STATIC doesn't make sense.")
|
||||
endif()
|
||||
if(NOT LLVM_ON_UNIX OR CYGWIN)
|
||||
message(STATUS "${name} ignored -- Loadable modules not supported on this platform.")
|
||||
return()
|
||||
endif()
|
||||
else()
|
||||
if(BUILD_SHARED_LIBS AND NOT ARG_STATIC)
|
||||
set(ARG_SHARED TRUE)
|
||||
@ -281,14 +288,11 @@ macro(add_llvm_library name)
|
||||
endmacro(add_llvm_library name)
|
||||
|
||||
macro(add_llvm_loadable_module name)
|
||||
if( NOT LLVM_ON_UNIX OR CYGWIN )
|
||||
message(STATUS "Loadable modules not supported on this platform.
|
||||
${name} ignored.")
|
||||
llvm_add_library(${name} MODULE ${ARGN})
|
||||
if(NOT TARGET ${name})
|
||||
# Add empty "phony" target
|
||||
add_custom_target(${name})
|
||||
else()
|
||||
llvm_add_library(${name} MODULE ${ARGN})
|
||||
|
||||
if( EXCLUDE_FROM_ALL )
|
||||
set_target_properties( ${name} PROPERTIES EXCLUDE_FROM_ALL ON)
|
||||
else()
|
||||
|
Loading…
x
Reference in New Issue
Block a user