Skip to content

Commit

Permalink
Override add_bare_module()
Browse files Browse the repository at this point in the history
  • Loading branch information
kasperisager committed Aug 22, 2024
1 parent 94107a1 commit 3e3828a
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions cmake/overrides.cmake
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
function(download_bare result)
cmake_parse_arguments(
PARSE_ARGV 1 ARGV "" "IMPORT_FILE" ""
)

set(import_file ${ARGV_IMPORT_FILE})
function(add_bare_module result)
bare_module_target("." target NAME name)

set(${result} $<TARGET_FILE:bare_bin>)
add_library(${target} OBJECT)

if(import_file)
set(${import_file} $<TARGET_IMPORT_FILE:bare_bin>)
endif()
set_target_properties(
${target}
PROPERTIES
C_STANDARD 11
CXX_STANDARD 20
POSITION_INDEPENDENT_CODE ON
)

return(PROPAGATE ${result} ${import_file})
endfunction()
target_include_directories(
${target}
PRIVATE
$<TARGET_PROPERTY:bare,INTERFACE_INCLUDE_DIRECTORIES>
)

function(download_bare_headers result)
set(${result} $<TARGET_PROPERTY:bare,INTERFACE_INCLUDE_DIRECTORIES>)
set(${result} ${target})

return(PROPAGATE ${result})
endfunction()

0 comments on commit 3e3828a

Please sign in to comment.