-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: use dedicated export macro for module
- Loading branch information
Showing
8 changed files
with
55 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
build | ||
include/saucer/export.h | ||
**/export.h | ||
|
||
.vs | ||
.cache | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
include(GenerateExportHeader) | ||
|
||
function(saucer_bindings_export NAME MACRO) | ||
generate_export_header( | ||
${NAME} | ||
EXPORT_MACRO_NAME "${MACRO}" | ||
EXPORT_FILE_NAME "${CMAKE_CURRENT_SOURCE_DIR}/include/saucer/export.h" | ||
) | ||
endfunction() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
function(saucer_bindings_add_module NAME MACRO) | ||
message(STATUS "[saucer-bindings] Adding module: ${NAME}") | ||
|
||
saucer_bindings_export(${NAME} ${MACRO}) | ||
get_target_property(priv_includes saucer::bindings INCLUDE_DIRECTORIES) | ||
|
||
target_link_libraries(${NAME} PUBLIC saucer::bindings) | ||
target_include_directories(${NAME} PRIVATE ${priv_includes}) | ||
endfunction() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,19 @@ | ||
#pragma once | ||
|
||
#include "memory.h" | ||
|
||
#include <string> | ||
|
||
namespace bindings | ||
{ | ||
char *alloc(const std::string &); | ||
inline char *alloc(const std::string &value) | ||
{ | ||
const auto size = value.size(); | ||
char *const rtn = static_cast<char *>(saucer_memory_alloc(size + 1)); | ||
|
||
value.copy(rtn, size); | ||
rtn[size] = '\0'; | ||
|
||
return rtn; | ||
} | ||
} // namespace bindings |
This file was deleted.
Oops, something went wrong.