Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
MIGraphX
Commits
413a57e1
Commit
413a57e1
authored
Dec 07, 2023
by
Paul
Browse files
Fix using the LD to embed files and enable by default when building shared libraries on linux
parent
fe61d940
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
cmake/Embed.cmake
cmake/Embed.cmake
+10
-5
No files found.
cmake/Embed.cmake
View file @
413a57e1
...
@@ -26,7 +26,11 @@ if(WIN32)
...
@@ -26,7 +26,11 @@ if(WIN32)
set
(
EMBED_USE RC CACHE STRING
"Use RC or CArrays to embed data files"
)
set
(
EMBED_USE RC CACHE STRING
"Use RC or CArrays to embed data files"
)
set_property
(
CACHE EMBED_USE PROPERTY STRINGS
"RC;CArrays"
)
set_property
(
CACHE EMBED_USE PROPERTY STRINGS
"RC;CArrays"
)
else
()
else
()
set
(
EMBED_USE CArrays CACHE STRING
"Use LD or CArrays to embed data files"
)
if
(
BUILD_SHARED_LIBS
)
set
(
EMBED_USE LD CACHE STRING
"Use LD or CArrays to embed data files"
)
else
()
set
(
EMBED_USE CArrays CACHE STRING
"Use LD or CArrays to embed data files"
)
endif
()
set_property
(
CACHE EMBED_USE PROPERTY STRINGS
"LD;CArrays"
)
set_property
(
CACHE EMBED_USE PROPERTY STRINGS
"LD;CArrays"
)
endif
()
endif
()
...
@@ -199,7 +203,11 @@ function(add_embed_library EMBED_NAME)
...
@@ -199,7 +203,11 @@ function(add_embed_library EMBED_NAME)
message
(
STATUS
"Generating embedding library '
${
EMBED_NAME
}
'"
)
message
(
STATUS
"Generating embedding library '
${
EMBED_NAME
}
'"
)
generate_embed_source
(
${
EMBED_NAME
}
${
EMBED_DIR
}
"
${
PARSE_RELATIVE
}
"
SYMBOLS
${
SYMBOLS
}
FILES
${
PARSE_UNPARSED_ARGUMENTS
}
)
generate_embed_source
(
${
EMBED_NAME
}
${
EMBED_DIR
}
"
${
PARSE_RELATIVE
}
"
SYMBOLS
${
SYMBOLS
}
FILES
${
PARSE_UNPARSED_ARGUMENTS
}
)
set
(
INTERNAL_EMBED_LIB embed_lib_
${
EMBED_NAME
}
)
set
(
INTERNAL_EMBED_LIB embed_lib_
${
EMBED_NAME
}
)
add_library
(
${
INTERNAL_EMBED_LIB
}
OBJECT
${
EMBED_FILES
}
)
if
(
EMBED_USE STREQUAL
"LD"
)
add_library
(
${
INTERNAL_EMBED_LIB
}
STATIC
${
EMBED_FILES
}
${
OUTPUT_FILES
}
)
else
()
add_library
(
${
INTERNAL_EMBED_LIB
}
OBJECT
${
EMBED_FILES
}
)
endif
()
if
(
EMBED_USE STREQUAL
"CArrays"
)
if
(
EMBED_USE STREQUAL
"CArrays"
)
target_sources
(
${
INTERNAL_EMBED_LIB
}
PRIVATE
${
OUTPUT_FILES
}
)
target_sources
(
${
INTERNAL_EMBED_LIB
}
PRIVATE
${
OUTPUT_FILES
}
)
endif
()
endif
()
...
@@ -207,9 +215,6 @@ function(add_embed_library EMBED_NAME)
...
@@ -207,9 +215,6 @@ function(add_embed_library EMBED_NAME)
target_compile_options
(
${
INTERNAL_EMBED_LIB
}
PRIVATE -Wno-reserved-identifier -Wno-extern-initializer -Wno-missing-variable-declarations
)
target_compile_options
(
${
INTERNAL_EMBED_LIB
}
PRIVATE -Wno-reserved-identifier -Wno-extern-initializer -Wno-missing-variable-declarations
)
set_target_properties
(
${
INTERNAL_EMBED_LIB
}
PROPERTIES POSITION_INDEPENDENT_CODE On
)
set_target_properties
(
${
INTERNAL_EMBED_LIB
}
PROPERTIES POSITION_INDEPENDENT_CODE On
)
add_library
(
${
EMBED_NAME
}
INTERFACE
)
add_library
(
${
EMBED_NAME
}
INTERFACE
)
if
(
EMBED_USE STREQUAL
"LD"
)
target_sources
(
${
EMBED_NAME
}
INTERFACE
${
OUTPUT_FILES
}
)
endif
()
if
(
EMBED_USE STREQUAL
"RC"
)
if
(
EMBED_USE STREQUAL
"RC"
)
target_link_libraries
(
${
EMBED_NAME
}
INTERFACE $<TARGET_OBJECTS:
${
INTERNAL_EMBED_LIB
}
>
)
target_link_libraries
(
${
EMBED_NAME
}
INTERFACE $<TARGET_OBJECTS:
${
INTERNAL_EMBED_LIB
}
>
)
endif
()
endif
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment