V1 #2
@@ -19,9 +19,6 @@ target_sources(${PROJECT_NAME}
|
|||||||
${SOURCES}
|
${SOURCES}
|
||||||
)
|
)
|
||||||
|
|
||||||
target_compile_options(${PROJECT_NAME} PRIVATE ${BIN2CPP_CXX_FLAGS})
|
|
||||||
target_link_options(${PROJECT_NAME} PRIVATE ${BIN2CPP_EXE_LINK_FLAGS})
|
|
||||||
|
|
||||||
target_link_libraries(${PROJECT_NAME} PUBLIC CLI11::CLI11 Bin2CPPLib)
|
target_link_libraries(${PROJECT_NAME} PUBLIC CLI11::CLI11 Bin2CPPLib)
|
||||||
target_link_libraries(${PROJECT_NAME} PRIVATE ${CMAKE_DL_LIBS})
|
target_link_libraries(${PROJECT_NAME} PRIVATE ${CMAKE_DL_LIBS})
|
||||||
|
|
||||||
@@ -31,14 +28,16 @@ set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER Bin2CPP/${ParentFolder})
|
|||||||
|
|
||||||
##################ASAN SETUP###################
|
##################ASAN SETUP###################
|
||||||
|
|
||||||
if (MSVC)
|
if(${ASAN})
|
||||||
get_filename_component(MSVC_BIN_DIR "${CMAKE_CXX_COMPILER}" DIRECTORY)
|
if (MSVC)
|
||||||
set(ASAN_DLL "${MSVC_BIN_DIR}/clang_rt.asan_dynamic-x86_64.dll")
|
get_filename_component(MSVC_BIN_DIR "${CMAKE_CXX_COMPILER}" DIRECTORY)
|
||||||
|
set(ASAN_DLL "${MSVC_BIN_DIR}/clang_rt.asan_dynamic-x86_64.dll")
|
||||||
|
|
||||||
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
|
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
|
||||||
COMMAND ${CMAKE_COMMAND} -E echo "Copying ASan DLL: ${ASAN_DLL} to $<TARGET_FILE_DIR:${PROJECT_NAME}>"
|
COMMAND ${CMAKE_COMMAND} -E echo "Copying ASan DLL: ${ASAN_DLL} to $<TARGET_FILE_DIR:${PROJECT_NAME}>"
|
||||||
COMMAND ${CMAKE_COMMAND} -E $<IF:$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>,copy_if_different,true>
|
COMMAND ${CMAKE_COMMAND} -E $<IF:$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>,copy_if_different,true>
|
||||||
"${ASAN_DLL}"
|
"${ASAN_DLL}"
|
||||||
"$<TARGET_FILE_DIR:${PROJECT_NAME}>"
|
"$<TARGET_FILE_DIR:${PROJECT_NAME}>"
|
||||||
)
|
)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
@@ -20,12 +20,9 @@ target_sources(${PROJECT_NAME}
|
|||||||
${SOURCES}
|
${SOURCES}
|
||||||
)
|
)
|
||||||
|
|
||||||
target_compile_options(${PROJECT_NAME} PRIVATE ${BINN2CPP_CXX_FLAGS})
|
target_link_libraries(${PROJECT_NAME} PUBLIC
|
||||||
|
|
||||||
target_link_libraries(${PROJECT_NAME} PUBLIC
|
|
||||||
EASTL::EASTL
|
EASTL::EASTL
|
||||||
$<$<CONFIG:Debug,RelWithDebInfo>:mimalloc-asan>
|
$<IF:$<BOOL:${ASAN}>,mimalloc-asan,mimalloc-static>
|
||||||
$<$<CONFIG:Release>:mimalloc-static>
|
|
||||||
quill::quill
|
quill::quill
|
||||||
$<$<CONFIG:Debug,RelWithDebInfo>:cpptrace::cpptrace>)
|
$<$<CONFIG:Debug,RelWithDebInfo>:cpptrace::cpptrace>)
|
||||||
|
|
||||||
|
|||||||
@@ -18,9 +18,6 @@ target_sources(${PROJECT_NAME}
|
|||||||
${TEST_SOURCES}
|
${TEST_SOURCES}
|
||||||
)
|
)
|
||||||
|
|
||||||
target_compile_options(${PROJECT_NAME} PRIVATE ${BIN2CPP_CXX_FLAGS})
|
|
||||||
target_link_options(${PROJECT_NAME} PRIVATE ${BIN2CPP_EXE_LINK_FLAGS})
|
|
||||||
|
|
||||||
target_link_libraries(${PROJECT_NAME} PRIVATE gtest::gtest Bin2CPPLib)
|
target_link_libraries(${PROJECT_NAME} PRIVATE gtest::gtest Bin2CPPLib)
|
||||||
|
|
||||||
include(GoogleTest)
|
include(GoogleTest)
|
||||||
@@ -32,16 +29,18 @@ set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER Tests/Bin2CPP/${ParentFo
|
|||||||
|
|
||||||
##################ASAN SETUP###################
|
##################ASAN SETUP###################
|
||||||
|
|
||||||
if (MSVC)
|
if(${ASAN})
|
||||||
get_filename_component(MSVC_BIN_DIR "${CMAKE_CXX_COMPILER}" DIRECTORY)
|
if (MSVC)
|
||||||
set(ASAN_DLL "${MSVC_BIN_DIR}/clang_rt.asan_dynamic-x86_64.dll")
|
get_filename_component(MSVC_BIN_DIR "${CMAKE_CXX_COMPILER}" DIRECTORY)
|
||||||
|
set(ASAN_DLL "${MSVC_BIN_DIR}/clang_rt.asan_dynamic-x86_64.dll")
|
||||||
|
|
||||||
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
|
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
|
||||||
COMMAND ${CMAKE_COMMAND} -E echo "Copying ASan DLL: ${ASAN_DLL} to $<TARGET_FILE_DIR:${PROJECT_NAME}>"
|
COMMAND ${CMAKE_COMMAND} -E echo "Copying ASan DLL: ${ASAN_DLL} to $<TARGET_FILE_DIR:${PROJECT_NAME}>"
|
||||||
COMMAND ${CMAKE_COMMAND} -E $<IF:$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>,copy_if_different,true>
|
COMMAND ${CMAKE_COMMAND} -E $<IF:$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>,copy_if_different,true>
|
||||||
"${ASAN_DLL}"
|
"${ASAN_DLL}"
|
||||||
"$<TARGET_FILE_DIR:${PROJECT_NAME}>"
|
"$<TARGET_FILE_DIR:${PROJECT_NAME}>"
|
||||||
)
|
)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
##################COPY FIXTURE FOLDER###################
|
##################COPY FIXTURE FOLDER###################
|
||||||
@@ -50,19 +49,7 @@ if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/Fixture)
|
|||||||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/Fixture)
|
file(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/Fixture)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Track all fixture files
|
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
|
||||||
file(GLOB_RECURSE FIXTURE_FILES
|
COMMAND ${CMAKE_COMMAND} -E copy_directory_if_different ${CMAKE_CURRENT_SOURCE_DIR}/Fixture $<TARGET_FILE_DIR:${PROJECT_NAME}>/Fixture
|
||||||
CONFIGURE_DEPENDS
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/Fixture/*
|
|
||||||
)
|
|
||||||
|
|
||||||
add_custom_target(${PROJECT_NAME}Fixture
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E remove_directory $<TARGET_FILE_DIR:${PROJECT_NAME}>/Fixture
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/Fixture $<TARGET_FILE_DIR:${PROJECT_NAME}>/Fixture
|
|
||||||
DEPENDS ${FIXTURE_FILES}
|
|
||||||
COMMENT "Copying Fixture folder ${CMAKE_CURRENT_SOURCE_DIR}/Fixture to $<TARGET_FILE_DIR:${PROJECT_NAME}>/Fixture"
|
COMMENT "Copying Fixture folder ${CMAKE_CURRENT_SOURCE_DIR}/Fixture to $<TARGET_FILE_DIR:${PROJECT_NAME}>/Fixture"
|
||||||
)
|
)
|
||||||
|
|
||||||
add_dependencies(${PROJECT_NAME} ${PROJECT_NAME}Fixture)
|
|
||||||
|
|
||||||
set_target_properties(${PROJECT_NAME}Fixture PROPERTIES FOLDER UtilityTargets/Tests/Bin2CPP/${ParentFolder})
|
|
||||||
@@ -9,14 +9,13 @@ find_package(EASTL REQUIRED)
|
|||||||
find_package(CLI11 REQUIRED)
|
find_package(CLI11 REQUIRED)
|
||||||
find_package(quill REQUIRED)
|
find_package(quill REQUIRED)
|
||||||
|
|
||||||
if(${IS_MULTI_CONFIG})
|
if(${ASAN})
|
||||||
find_package(mimalloc REQUIRED)
|
|
||||||
find_package(mimalloc-asan REQUIRED)
|
find_package(mimalloc-asan REQUIRED)
|
||||||
find_package(cpptrace REQUIRED)
|
else()
|
||||||
elseif(${CMAKE_BUILD_TYPE} STREQUAL "Release")
|
|
||||||
find_package(mimalloc REQUIRED)
|
find_package(mimalloc REQUIRED)
|
||||||
elseif(${CMAKE_BUILD_TYPE} STREQUAL "Debug" OR ${CMAKE_BUILD_TYPE} STREQUAL "RelWithDebInfo")
|
endif()
|
||||||
find_package(mimalloc-asan REQUIRED)
|
|
||||||
|
if(${IS_MULTI_CONFIG} OR ${CMAKE_BUILD_TYPE} STREQUAL "Debug" OR ${CMAKE_BUILD_TYPE} STREQUAL "RelWithDebInfo")
|
||||||
find_package(cpptrace REQUIRED)
|
find_package(cpptrace REQUIRED)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.24)
|
cmake_minimum_required(VERSION 3.26)
|
||||||
|
|
||||||
foreach(config DEBUG RELWITHDEBINFO)
|
|
||||||
foreach(lang EXE SHARED MODULE)
|
|
||||||
if("${CMAKE_${lang}_LINKER_FLAGS_${config}}" MATCHES "/INCREMENTAL:NO")
|
|
||||||
string(REGEX REPLACE "/INCREMENTAL([^:]|$)" ""
|
|
||||||
CMAKE_${lang}_LINKER_FLAGS_${config}
|
|
||||||
"${CMAKE_${lang}_LINKER_FLAGS_${config}}")
|
|
||||||
endif()
|
|
||||||
endforeach()
|
|
||||||
endforeach()
|
|
||||||
|
|
||||||
project(Bin2CPP VERSION 0.1.0
|
project(Bin2CPP VERSION 0.1.0
|
||||||
DESCRIPTION "Bin2CPP"
|
DESCRIPTION "Bin2CPP"
|
||||||
@@ -23,12 +13,24 @@ get_property(IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
|||||||
set(CMAKE_CONFIGURATION_TYPES "Release;RelWithDebInfo;Debug" CACHE STRING "" FORCE)
|
set(CMAKE_CONFIGURATION_TYPES "Release;RelWithDebInfo;Debug" CACHE STRING "" FORCE)
|
||||||
|
|
||||||
option(BUILD_TESTS OFF)
|
option(BUILD_TESTS OFF)
|
||||||
|
option(ASAN OFF)
|
||||||
|
|
||||||
include(${CMAKE_SOURCE_DIR}/CMake/FindDependencies.cmake)
|
include(${CMAKE_SOURCE_DIR}/CMake/FindDependencies.cmake)
|
||||||
|
|
||||||
|
foreach(CONFIG DEBUG RELWITHDEBINFO)
|
||||||
|
if("${CMAKE_EXE_LINKER_FLAGS_${CONFIG}}" MATCHES "/INCREMENTAL:NO")
|
||||||
|
string(REGEX REPLACE "/INCREMENTAL([^:]|$)" ""
|
||||||
|
CMAKE_EXE_LINKER_FLAGS_${CONFIG}
|
||||||
|
"${CMAKE_EXE_LINKER_FLAGS_${CONFIG}}")
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
|
||||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||||
set(CMAKE_OPTIMIZE_DEPENDENCIES 1)
|
set(CMAKE_OPTIMIZE_DEPENDENCIES 1)
|
||||||
|
|
||||||
|
add_compile_options(${BIN2CPP_CXX_FLAGS})
|
||||||
|
add_link_options(${BIN2CPP_EXE_LINK_FLAGS})
|
||||||
|
|
||||||
add_compile_definitions(
|
add_compile_definitions(
|
||||||
$<$<CONFIG:Release>:BIN2CPP_OPTIMIZED>
|
$<$<CONFIG:Release>:BIN2CPP_OPTIMIZED>
|
||||||
$<$<CONFIG:Debug,RelWithDebInfo>:BIN2CPP_NOT_OPTIMIZED>
|
$<$<CONFIG:Debug,RelWithDebInfo>:BIN2CPP_NOT_OPTIMIZED>
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ build_type=Release
|
|||||||
[conf]
|
[conf]
|
||||||
tools.cmake.cmaketoolchain:extra_variables={'CMAKE_CXX_COMPILER_LAUNCHER': 'ccache', 'CMAKE_C_COMPILER_LAUNCHER': 'ccache'}
|
tools.cmake.cmaketoolchain:extra_variables={'CMAKE_CXX_COMPILER_LAUNCHER': 'ccache', 'CMAKE_C_COMPILER_LAUNCHER': 'ccache'}
|
||||||
tools.cmake.cmaketoolchain:extra_variables*={'BIN2CPP_CXX_FLAGS': {'value': '-Wall;-Wextra;-Wpedantic;-Werror', 'cache': True, 'type': 'STRING', 'docstring': 'CXX flags for Bigfoot', 'force': True}}
|
tools.cmake.cmaketoolchain:extra_variables*={'BIN2CPP_CXX_FLAGS': {'value': '-Wall;-Wextra;-Wpedantic;-Werror', 'cache': True, 'type': 'STRING', 'docstring': 'CXX flags for Bigfoot', 'force': True}}
|
||||||
tools.cmake.cmaketoolchain:extra_variables*={'BIN2CPP_C_FLAGS': {'value': '-Wall;-Wextra;-Wpedantic;-Werror', 'cache': True, 'type': 'STRING', 'docstring': 'C flags for Bigfoot', 'force': True}}
|
|
||||||
|
|
||||||
tools.system.package_manager:mode=install
|
tools.system.package_manager:mode=install
|
||||||
tools.system.package_manager:sudo=True
|
tools.system.package_manager:sudo=True
|
||||||
@@ -28,4 +27,7 @@ tools.build:compiler_executables={"c": "clang", "cpp": "clang++"}
|
|||||||
tools.cmake.cmaketoolchain:generator=Ninja
|
tools.cmake.cmaketoolchain:generator=Ninja
|
||||||
|
|
||||||
[tool_requires]
|
[tool_requires]
|
||||||
!cmake/*: cmake/[>=4.2]
|
!cmake/*: cmake/[>=4.2]
|
||||||
|
|
||||||
|
[options]
|
||||||
|
Bin2CPP/*:build_tests=True
|
||||||
@@ -12,8 +12,6 @@ build_type=Debug
|
|||||||
[conf]
|
[conf]
|
||||||
tools.cmake.cmaketoolchain:extra_variables={'CMAKE_CXX_COMPILER_LAUNCHER': 'ccache', 'CMAKE_C_COMPILER_LAUNCHER': 'ccache'}
|
tools.cmake.cmaketoolchain:extra_variables={'CMAKE_CXX_COMPILER_LAUNCHER': 'ccache', 'CMAKE_C_COMPILER_LAUNCHER': 'ccache'}
|
||||||
tools.cmake.cmaketoolchain:extra_variables*={'BIN2CPP_CXX_FLAGS': {'value': '-Wall;-Wextra;-Wpedantic;-Werror;-fprofile-instr-generate;-fcoverage-mapping', 'cache': True, 'type': 'STRING', 'docstring': 'CXX flags for Bigfoot', 'force': True}}
|
tools.cmake.cmaketoolchain:extra_variables*={'BIN2CPP_CXX_FLAGS': {'value': '-Wall;-Wextra;-Wpedantic;-Werror;-fprofile-instr-generate;-fcoverage-mapping', 'cache': True, 'type': 'STRING', 'docstring': 'CXX flags for Bigfoot', 'force': True}}
|
||||||
tools.cmake.cmaketoolchain:extra_variables*={'BIN2CPP_C_FLAGS': {'value': '-Wall;-Wextra;-Wpedantic;-Werror;-fprofile-instr-generate;-fcoverage-mapping', 'cache': True, 'type': 'STRING', 'docstring': 'C flags for Bigfoot', 'force': True}}
|
|
||||||
tools.cmake.cmaketoolchain:extra_variables*={'BIN2CPP_SHARED_LINK_FLAGS': {'value': '-fprofile-instr-generate', 'cache': True, 'type': 'STRING', 'docstring': 'SHARED link flags for Bigfoot', 'force': True}}
|
|
||||||
tools.cmake.cmaketoolchain:extra_variables*={'BIN2CPP_EXE_LINK_FLAGS': {'value': '-fprofile-instr-generate', 'cache': True, 'type': 'STRING', 'docstring': 'EXE link flags for Bigfoot', 'force': True}}
|
tools.cmake.cmaketoolchain:extra_variables*={'BIN2CPP_EXE_LINK_FLAGS': {'value': '-fprofile-instr-generate', 'cache': True, 'type': 'STRING', 'docstring': 'EXE link flags for Bigfoot', 'force': True}}
|
||||||
|
|
||||||
tools.system.package_manager:mode=install
|
tools.system.package_manager:mode=install
|
||||||
@@ -27,4 +25,7 @@ tools.build:compiler_executables={"c": "clang", "cpp": "clang++"}
|
|||||||
tools.cmake.cmaketoolchain:generator=Ninja
|
tools.cmake.cmaketoolchain:generator=Ninja
|
||||||
|
|
||||||
[tool_requires]
|
[tool_requires]
|
||||||
!cmake/*: cmake/[>=4.2]
|
!cmake/*: cmake/[>=4.2]
|
||||||
|
|
||||||
|
[options]
|
||||||
|
Bin2CPP/*:build_tests=True
|
||||||
@@ -12,8 +12,6 @@ build_type=Debug
|
|||||||
[conf]
|
[conf]
|
||||||
tools.cmake.cmaketoolchain:extra_variables={'CMAKE_CXX_COMPILER_LAUNCHER': 'ccache', 'CMAKE_C_COMPILER_LAUNCHER': 'ccache'}
|
tools.cmake.cmaketoolchain:extra_variables={'CMAKE_CXX_COMPILER_LAUNCHER': 'ccache', 'CMAKE_C_COMPILER_LAUNCHER': 'ccache'}
|
||||||
tools.cmake.cmaketoolchain:extra_variables*={'BIN2CPP_CXX_FLAGS': {'value': '-Wall;-Wextra;-Wpedantic;-Werror;-fsanitize=address,undefined;-fno-sanitize-recover=all', 'cache': True, 'type': 'STRING', 'docstring': 'CXX flags for Bigfoot', 'force': True}}
|
tools.cmake.cmaketoolchain:extra_variables*={'BIN2CPP_CXX_FLAGS': {'value': '-Wall;-Wextra;-Wpedantic;-Werror;-fsanitize=address,undefined;-fno-sanitize-recover=all', 'cache': True, 'type': 'STRING', 'docstring': 'CXX flags for Bigfoot', 'force': True}}
|
||||||
tools.cmake.cmaketoolchain:extra_variables*={'BIN2CPP_C_FLAGS': {'value': '-Wall;-Wextra;-Wpedantic;-Werror;-fsanitize=address,undefined;-fno-sanitize-recover=all', 'cache': True, 'type': 'STRING', 'docstring': 'C flags for Bigfoot', 'force': True}}
|
|
||||||
tools.cmake.cmaketoolchain:extra_variables*={'BIN2CPP_SHARED_LINK_FLAGS': {'value': '-fsanitize=address,undefined', 'cache': True, 'type': 'STRING', 'docstring': 'SHARED link flags for Bigfoot', 'force': True}}
|
|
||||||
tools.cmake.cmaketoolchain:extra_variables*={'BIN2CPP_EXE_LINK_FLAGS': {'value': '-fsanitize=address,undefined', 'cache': True, 'type': 'STRING', 'docstring': 'EXE link flags for Bigfoot', 'force': True}}
|
tools.cmake.cmaketoolchain:extra_variables*={'BIN2CPP_EXE_LINK_FLAGS': {'value': '-fsanitize=address,undefined', 'cache': True, 'type': 'STRING', 'docstring': 'EXE link flags for Bigfoot', 'force': True}}
|
||||||
|
|
||||||
tools.system.package_manager:mode=install
|
tools.system.package_manager:mode=install
|
||||||
@@ -27,4 +25,8 @@ tools.cmake.cmaketoolchain:generator=Ninja
|
|||||||
tools.build:compiler_executables={"c": "clang", "cpp": "clang++"}
|
tools.build:compiler_executables={"c": "clang", "cpp": "clang++"}
|
||||||
|
|
||||||
[tool_requires]
|
[tool_requires]
|
||||||
!cmake/*: cmake/[>=4.2]
|
!cmake/*: cmake/[>=4.2]
|
||||||
|
|
||||||
|
[options]
|
||||||
|
Bin2CPP/*:asan=True
|
||||||
|
Bin2CPP/*:build_tests=True
|
||||||
@@ -10,14 +10,15 @@ build_type=Release
|
|||||||
|
|
||||||
[conf]
|
[conf]
|
||||||
tools.cmake.cmaketoolchain:extra_variables={'BIN2CPP_CXX_FLAGS': {'value': '/W4;/WX;', 'cache': True, 'type': 'STRING', 'docstring': 'CXX flags for Bigfoot', 'force': True}}
|
tools.cmake.cmaketoolchain:extra_variables={'BIN2CPP_CXX_FLAGS': {'value': '/W4;/WX;', 'cache': True, 'type': 'STRING', 'docstring': 'CXX flags for Bigfoot', 'force': True}}
|
||||||
tools.cmake.cmaketoolchain:extra_variables*={'BIN2CPP_C_FLAGS': {'value': '/W4;/WX;', 'cache': True, 'type': 'STRING', 'docstring': 'C flags for Bigfoot', 'force': True}}
|
|
||||||
tools.cmake.cmaketoolchain:user_toolchain+={{profile_dir}}/msvc_ccache.cmake
|
tools.cmake.cmaketoolchain:user_toolchain+={{profile_dir}}/msvc_ccache.cmake
|
||||||
|
|
||||||
tools.build:exelinkflags=["/LTCG", "/INCREMENTAL:NO"]
|
tools.build:exelinkflags=["/LTCG", "/INCREMENTAL:NO"]
|
||||||
tools.build:sharedlinkflags=["/LTCG", "/INCREMENTAL:NO"]
|
|
||||||
|
|
||||||
tools.build:cflags=["/Zc:preprocessor", "/Zc:__STDC__", "/D_CRT_DECLARE_NONSTDC_NAMES=1", "/GL"]
|
tools.build:cflags=["/Zc:preprocessor", "/Zc:__STDC__", "/D_CRT_DECLARE_NONSTDC_NAMES=1", "/GL"]
|
||||||
tools.build:cxxflags=["/Zc:preprocessor", "/Zc:__cplusplus", "/Zc:enumTypes", "/Zc:templateScope", "/Zc:strictStrings", "/Zc:rvalueCast", "/Zc:hiddenFriend", "/Zc:externConstexpr", "/Zc:ternary", "/GL"]
|
tools.build:cxxflags=["/Zc:preprocessor", "/Zc:__cplusplus", "/Zc:enumTypes", "/Zc:templateScope", "/Zc:strictStrings", "/Zc:rvalueCast", "/Zc:hiddenFriend", "/Zc:externConstexpr", "/Zc:ternary", "/GL"]
|
||||||
|
|
||||||
[tool_requires]
|
[tool_requires]
|
||||||
!cmake/*: cmake/[>=4.2]
|
!cmake/*: cmake/[>=4.2]
|
||||||
|
|
||||||
|
[options]
|
||||||
|
Bin2CPP/*:build_tests=True
|
||||||
@@ -10,14 +10,16 @@ build_type=Debug
|
|||||||
|
|
||||||
[conf]
|
[conf]
|
||||||
tools.cmake.cmaketoolchain:extra_variables={'BIN2CPP_CXX_FLAGS': {'value': '/W4;/WX', 'cache': True, 'type': 'STRING', 'docstring': 'CXX flags for Bigfoot', 'force': True}}
|
tools.cmake.cmaketoolchain:extra_variables={'BIN2CPP_CXX_FLAGS': {'value': '/W4;/WX', 'cache': True, 'type': 'STRING', 'docstring': 'CXX flags for Bigfoot', 'force': True}}
|
||||||
tools.cmake.cmaketoolchain:extra_variables*={'BIN2CPP_C_FLAGS': {'value': '/W4;/WX', 'cache': True, 'type': 'STRING', 'docstring': 'C flags for Bigfoot', 'force': True}}
|
|
||||||
tools.cmake.cmaketoolchain:user_toolchain+={{profile_dir}}/msvc_ccache.cmake
|
tools.cmake.cmaketoolchain:user_toolchain+={{profile_dir}}/msvc_ccache.cmake
|
||||||
|
|
||||||
tools.build:exelinkflags=["/INCREMENTAL:NO"]
|
tools.build:exelinkflags=["/INCREMENTAL:NO"]
|
||||||
tools.build:sharedlinkflags=["/INCREMENTAL:NO"]
|
|
||||||
|
|
||||||
tools.build:cflags=["/Zc:preprocessor", "/Zc:__STDC__", "/D_CRT_DECLARE_NONSTDC_NAMES=1", "/fsanitize=address"]
|
tools.build:cflags=["/Zc:preprocessor", "/Zc:__STDC__", "/D_CRT_DECLARE_NONSTDC_NAMES=1", "/fsanitize=address"]
|
||||||
tools.build:cxxflags=["/Zc:preprocessor", "/Zc:__cplusplus", "/Zc:enumTypes", "/Zc:templateScope", "/Zc:strictStrings", "/Zc:rvalueCast", "/Zc:hiddenFriend", "/Zc:externConstexpr", "/Zc:ternary", "/fsanitize=address"]
|
tools.build:cxxflags=["/Zc:preprocessor", "/Zc:__cplusplus", "/Zc:enumTypes", "/Zc:templateScope", "/Zc:strictStrings", "/Zc:rvalueCast", "/Zc:hiddenFriend", "/Zc:externConstexpr", "/Zc:ternary", "/fsanitize=address"]
|
||||||
|
|
||||||
[tool_requires]
|
[tool_requires]
|
||||||
!cmake/*: cmake/[>=4.2]
|
!cmake/*: cmake/[>=4.2]
|
||||||
|
|
||||||
|
[options]
|
||||||
|
Bin2CPP/*:asan=True
|
||||||
|
Bin2CPP/*:build_tests=True
|
||||||
|
|||||||
14
conanfile.py
14
conanfile.py
@@ -5,13 +5,14 @@ import os
|
|||||||
|
|
||||||
required_conan_version = ">=1.33.0"
|
required_conan_version = ">=1.33.0"
|
||||||
|
|
||||||
class Bigfoot(ConanFile):
|
class Bin2CPP(ConanFile):
|
||||||
name = "bin2cpp"
|
name = "Bin2CPP"
|
||||||
homepage = "https://git.romainboullard.com/rboullard/Bin2CPP"
|
homepage = "https://git.romainboullard.com/rboullard/Bin2CPP"
|
||||||
description = "A utility that converts files to CPP headers"
|
description = "A utility that converts files to CPP headers"
|
||||||
topics = ("utility")
|
topics = ("utility")
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
version = "0.1.0"
|
version = "1.0.0"
|
||||||
|
package_type = "application"
|
||||||
|
|
||||||
# Binary configuration
|
# Binary configuration
|
||||||
settings = "os", "compiler", "build_type", "arch"
|
settings = "os", "compiler", "build_type", "arch"
|
||||||
@@ -19,11 +20,13 @@ class Bigfoot(ConanFile):
|
|||||||
"shared": [True, False],
|
"shared": [True, False],
|
||||||
"fPIC": [True, False],
|
"fPIC": [True, False],
|
||||||
"build_tests": [True, False],
|
"build_tests": [True, False],
|
||||||
|
"asan": [True, False]
|
||||||
}
|
}
|
||||||
default_options = {
|
default_options = {
|
||||||
"shared": False,
|
"shared": False,
|
||||||
"fPIC": True,
|
"fPIC": True,
|
||||||
"build_tests": False,
|
"build_tests": False,
|
||||||
|
"asan": False
|
||||||
}
|
}
|
||||||
|
|
||||||
generators = "CMakeDeps"
|
generators = "CMakeDeps"
|
||||||
@@ -35,7 +38,7 @@ class Bigfoot(ConanFile):
|
|||||||
if self.settings.os == "Windows":
|
if self.settings.os == "Windows":
|
||||||
del self.options.fPIC
|
del self.options.fPIC
|
||||||
|
|
||||||
if(self.settings.build_type == "RelWithDebInfo" or self.settings.build_type == "Debug"):
|
if(self.options.asan and (self.settings.build_type == "RelWithDebInfo" or self.settings.build_type == "Debug")):
|
||||||
self.options["mimalloc"].asan = True
|
self.options["mimalloc"].asan = True
|
||||||
|
|
||||||
def requirements(self):
|
def requirements(self):
|
||||||
@@ -52,8 +55,9 @@ class Bigfoot(ConanFile):
|
|||||||
|
|
||||||
def generate(self):
|
def generate(self):
|
||||||
tc = CMakeToolchain(self)
|
tc = CMakeToolchain(self)
|
||||||
|
|
||||||
tc.variables["BUILD_TESTS"] = self.options.build_tests
|
tc.variables["BUILD_TESTS"] = self.options.build_tests
|
||||||
|
tc.variables["ASAN"] = self.options.asan
|
||||||
|
|
||||||
tc.generate()
|
tc.generate()
|
||||||
|
|
||||||
|
|||||||
@@ -23,8 +23,8 @@ REM Add the remote
|
|||||||
conan remote add bigfootpackages https://conan.romainboullard.com/artifactory/api/conan/BigfootPackages
|
conan remote add bigfootpackages https://conan.romainboullard.com/artifactory/api/conan/BigfootPackages
|
||||||
|
|
||||||
REM Install dependencies with the specified build option
|
REM Install dependencies with the specified build option
|
||||||
conan install . --deployer=full_deploy --remote=bigfootpackages -pr:h=./ConanProfiles/msvc -pr:b=./ConanProfiles/msvc %build_option% -of build -s build_type=Release -o bin2cpp/*:build_tests=True
|
conan install . --deployer=full_deploy --remote=bigfootpackages -pr:h=./ConanProfiles/msvc -pr:b=./ConanProfiles/msvc %build_option% -of build -s build_type=Release
|
||||||
conan install . --deployer=full_deploy --remote=bigfootpackages -pr:h=./ConanProfiles/msvcd -pr:b=./ConanProfiles/msvcd %build_option% -of build -s build_type=RelWithDebInfo -o bin2cpp/*:build_tests=True
|
conan install . --deployer=full_deploy --remote=bigfootpackages -pr:h=./ConanProfiles/msvcd -pr:b=./ConanProfiles/msvcd %build_option% -of build -s build_type=RelWithDebInfo
|
||||||
conan install . --deployer=full_deploy --remote=bigfootpackages -pr:h=./ConanProfiles/msvcd -pr:b=./ConanProfiles/msvcd %build_option% -of build -s build_type=Debug -o bin2cpp/*:build_tests=True
|
conan install . --deployer=full_deploy --remote=bigfootpackages -pr:h=./ConanProfiles/msvcd -pr:b=./ConanProfiles/msvcd %build_option% -of build -s build_type=Debug
|
||||||
|
|
||||||
endlocal
|
endlocal
|
||||||
|
|||||||
@@ -11,13 +11,13 @@ conan remote add bigfootpackages https://conan.romainboullard.com/artifactory/ap
|
|||||||
|
|
||||||
# Set the build option based on the argument
|
# Set the build option based on the argument
|
||||||
if [ "$1" == "force" ]; then
|
if [ "$1" == "force" ]; then
|
||||||
conan install . --deployer=full_deploy --remote=bigfootpackages -pr:h=./ConanProfiles/clang -pr:b=./ConanProfiles/clang --build='*' -of build -s build_type=Release -o bin2cpp/*:build_tests=True
|
conan install . --deployer=full_deploy --remote=bigfootpackages -pr:h=./ConanProfiles/clang -pr:b=./ConanProfiles/clang --build='*' -of build -s build_type=Release
|
||||||
conan install . --deployer=full_deploy --remote=bigfootpackages -pr:h=./ConanProfiles/clangd -pr:b=./ConanProfiles/clangd --build='*' -of build -s build_type=RelWithDebInfo -o bin2cpp/*:build_tests=True
|
conan install . --deployer=full_deploy --remote=bigfootpackages -pr:h=./ConanProfiles/clangd -pr:b=./ConanProfiles/clangd --build='*' -of build -s build_type=RelWithDebInfo
|
||||||
conan install . --deployer=full_deploy --remote=bigfootpackages -pr:h=./ConanProfiles/clangd -pr:b=./ConanProfiles/clangd --build='*' -of build -s build_type=Debug -o bin2cpp/*:build_tests=True
|
conan install . --deployer=full_deploy --remote=bigfootpackages -pr:h=./ConanProfiles/clangd -pr:b=./ConanProfiles/clangd --build='*' -of build -s build_type=Debug
|
||||||
elif [ "$1" == "missing" ]; then
|
elif [ "$1" == "missing" ]; then
|
||||||
conan install . --deployer=full_deploy --remote=bigfootpackages -pr:h=./ConanProfiles/clang -pr:b=./ConanProfiles/clang --build=missing -of build -s build_type=Release -o bin2cpp/*:build_tests=True
|
conan install . --deployer=full_deploy --remote=bigfootpackages -pr:h=./ConanProfiles/clang -pr:b=./ConanProfiles/clang --build=missing -of build -s build_type=Release
|
||||||
conan install . --deployer=full_deploy --remote=bigfootpackages -pr:h=./ConanProfiles/clangd -pr:b=./ConanProfiles/clangd --build=missing -of build -s build_type=RelWithDebInfo -o bin2cpp/*:build_tests=True
|
conan install . --deployer=full_deploy --remote=bigfootpackages -pr:h=./ConanProfiles/clangd -pr:b=./ConanProfiles/clangd --build=missing -of build -s build_type=RelWithDebInfo
|
||||||
conan install . --deployer=full_deploy --remote=bigfootpackages -pr:h=./ConanProfiles/clangd -pr:b=./ConanProfiles/clangd --build=missing -of build -s build_type=Debug -o bin2cpp/*:build_tests=True
|
conan install . --deployer=full_deploy --remote=bigfootpackages -pr:h=./ConanProfiles/clangd -pr:b=./ConanProfiles/clangd --build=missing -of build -s build_type=Debug
|
||||||
else
|
else
|
||||||
echo "Invalid argument: $1"
|
echo "Invalid argument: $1"
|
||||||
echo "Usage: $0 [force|missing]"
|
echo "Usage: $0 [force|missing]"
|
||||||
|
|||||||
Reference in New Issue
Block a user