Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Snaipe/fmem
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: cpp-testing/fmem
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 12 commits
  • 2 files changed
  • 6 contributors

Commits on Jul 8, 2017

  1. 🆕 C++ linking support

    kris-jusiak committed Jul 8, 2017
    Copy the full SHA
    243d086 View commit details

Commits on Jan 9, 2018

  1. Copy the full SHA
    28d7259 View commit details

Commits on Feb 17, 2018

  1. Modification pou vcpkg

    Ambrou committed Feb 17, 2018
    Copy the full SHA
    53ec33d View commit details
  2. Merge pull request #1 from Ambrou/master

    Update for use with vcpkg microsoft tools
    kris-jusiak authored Feb 17, 2018

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    2ccee3d View commit details

Commits on Mar 31, 2019

  1. Avoid CMP0048 warning

    Problem:
    - When `fmem`'s `CMakeLists.txt` gets included from a parent project via
      an `include_directory` where the parent has a CMake min version of 3.0
      requirement, the `fmem` `project()` call results in a CMP0048 warning.
    
    Solution:
    - If the CMake policy 0048 is available (i.e. if CMake 3.0 or later is
      used), set the policy to `NEW`.
    - This results in the warning going away for parent projects using CMake
      3.0 or later. This has no effect on those using earlier versions of
      CMake.
    JoeLoser committed Mar 31, 2019

    Verified

    This commit was signed with the committer’s verified signature.
    JoeLoser Joe Loser
    Copy the full SHA
    56ffcb9 View commit details

Commits on Apr 2, 2019

  1. Merge pull request #2 from JoeLoser/cmake_policy

    Avoid CMP0048 warning
    kris-jusiak authored Apr 2, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    dc33801 View commit details

Commits on Jul 14, 2021

  1. Added CMake option for BUILD_TESTING which defaults to OFF

    Joachim Schiele committed Jul 14, 2021
    Copy the full SHA
    d35995f View commit details

Commits on Jul 15, 2021

  1. Installing the right files, there is no fmem-export.h nor a fmem.h, o…

    …nly the generated one
    Joachim Schiele committed Jul 15, 2021
    Copy the full SHA
    7362041 View commit details
  2. Merge pull request #3 from qknight/add_BUILD_TESTING_option_with_OFF_…

    …default_and_target_include_directories
    
    Added CMake option for BUILD_TESTING which defaults to OFF
    kris-jusiak authored Jul 15, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    ffc5e01 View commit details

Commits on Mar 21, 2022

  1. Added static linking flags for MSVC

    Rafael Andrioli Bauer committed Mar 21, 2022
    Copy the full SHA
    fc97036 View commit details
  2. Merge pull request #4 from rafaelBauer/master

    Added static linking flags for MSVC
    kris-jusiak authored Mar 21, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    0a19b25 View commit details

Commits on Apr 2, 2025

  1. 🔧 ⬆️ [cmake] 3.5

    kris-jusiak committed Apr 2, 2025
    Copy the full SHA
    611acb8 View commit details
Showing with 32 additions and 4 deletions.
  1. +24 −4 CMakeLists.txt
  2. +8 −0 include/fmem.h.in
28 changes: 24 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -2,12 +2,33 @@
# Redistribution and use of this file is allowed according to the terms of the MIT license.
# For details see the LICENSE file distributed with Mimick.

cmake_minimum_required (VERSION 2.8)
cmake_minimum_required (VERSION 3.5)

option(BUILD_SHARED_LIBS "Build shared library." OFF)
option(BUILD_TESTING "Build tests." OFF)

if (POLICY CMP0048)
# cmake warns if fmem is included from a parent directory whose CMakeLists.txt
# requires a CMake version of 3.0 or later
cmake_policy(SET CMP0048 NEW)
endif()

project (fmem C)

OPTION(BUILD_TESTING "Build the tests with ON, defaults to OFF" OFF)

list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/.cmake")

if(MSVC AND NOT BUILD_SHARED_LIBS)
add_compile_options(/EHsc)
# See https://gitlab.kitware.com/cmake/cmake/-/issues/18390
add_compile_options(
$<$<CONFIG:>:/MT>
$<$<CONFIG:Debug>:/MTd>
$<$<CONFIG:Release>:/MT>
)
endif(MSVC AND NOT BUILD_SHARED_LIBS)

include (CheckSymbolExists)
include (CheckCSourceCompiles)
include (GNUInstallDirs)
@@ -74,8 +95,8 @@ else ()
message (FATAL_ERROR "No memory stream implementation found")
endif ()

include_directories (include src ${PROJECT_BINARY_DIR}/gen)
add_library (fmem ${SOURCES})
target_include_directories (fmem PUBLIC ${PROJECT_BINARY_DIR}/gen)

get_property (FMEM_LIBTYPE
TARGET fmem
@@ -115,8 +136,7 @@ install(TARGETS fmem
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})

install(FILES
fmem.h
${PROJECT_BINARY_DIR}/gen/fmem-export.h
${PROJECT_BINARY_DIR}/gen/fmem.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})

include (CTest)
8 changes: 8 additions & 0 deletions include/fmem.h.in
Original file line number Diff line number Diff line change
@@ -11,9 +11,17 @@ struct fmem_reserved {

typedef struct fmem_reserved fmem;

#ifdef __cplusplus
extern "C" {
#endif

FMEM_API void fmem_init(fmem *file);
FMEM_API void fmem_term(fmem *file);
FMEM_API FILE *fmem_open(fmem *file, const char *mode);
FMEM_API void fmem_mem(fmem *file, void **mem, size_t *size);

#ifdef __cplusplus
}
#endif

#endif /* !FMEM_H_ */