Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/system/dmod_system.c
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,7 @@ bool Dmod_FindModuleFile(const char* ModuleName, const char* ArchName, char* out
ArchName = DMOD_ARCH;
}

bool crossplatform = Dmod_IsCrossplatformMode();
Dmod_SearchNode_t* searchNode = Dmod_Hlp_PrepareModulesSearchNodes();
Dmod_SearchNode_t* currentNode = searchNode;
while( currentNode != NULL )
Expand All @@ -560,13 +561,12 @@ bool Dmod_FindModuleFile(const char* ModuleName, const char* ArchName, char* out
(
PrepareModulePath(repoDir, ModuleName, false, outFilePath, MaxLength)
&& Dmod_FileAvailable(outFilePath)
&& CheckModuleArchitecture(outFilePath, ArchName)
&& (crossplatform || CheckModuleArchitecture(outFilePath, ArchName))
) ||
(
PrepareModulePath(repoDir, ModuleName, true, outFilePath, MaxLength)
&& Dmod_FileAvailable(outFilePath)
&& CheckModuleArchitecture(outFilePath, ArchName
)
&& (crossplatform || CheckModuleArchitecture(outFilePath, ArchName))
)
)
{
Expand Down
86 changes: 86 additions & 0 deletions tools-cfg.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
#================================================================================================================================
# Default tools configuration
#================================================================================================================================

#
# Default configuration options
#
set(DMOD_USE_STDLIB ON )
set(DMOD_USE_STDIO ON )
set(DMOD_USE_ASSERT ON )
set(DMOD_USE_PTHREAD ON )
set(DMOD_USE_MMAN ON )
set(DMOD_BUILD_TESTS ON )
set(DMOD_BUILD_EXAMPLES ON )
set(DMOD_BUILD_TOOLS ON )

#
# Toolchain configuration
#
if(NOT DEFINED COMPILER_PATH)
set(COMPILER_PATH "")
endif()
if(NOT DEFINED CROSS_COMPILE)
set(CROSS_COMPILE "")
endif()



#
# Toolchain configuration
#
if(NOT DEFINED CROSS_COMPILE)
set(CROSS_COMPILE "")
endif()

find_program(GCC ${CROSS_COMPILE}gcc)
if(NOT GCC)
message(FATAL_ERROR "GCC compiler not found")
endif()

find_program(GXX ${CROSS_COMPILE}g++)
if(NOT GXX)
message(FATAL_ERROR "G++ compiler not found")
endif()

find_program(LD ${CROSS_COMPILE}ld)
if(NOT LD)
message(FATAL_ERROR "Linker not found")
endif()

find_program(OBJDUMP ${CROSS_COMPILE}objdump)
if(NOT OBJDUMP)
message(FATAL_ERROR "objdump not found")
endif()

find_program(OBJCOPY ${CROSS_COMPILE}objcopy)
if(NOT OBJCOPY)
message(FATAL_ERROR "objcopy not found")
endif()

find_program(AR ${CROSS_COMPILE}ar)
if(NOT AR)
message(FATAL_ERROR "ar not found")
endif()

find_program(SIZE ${CROSS_COMPILE}size)
if(NOT SIZE)
message(FATAL_ERROR "size not found")
endif()

# ==============================================================================
# CMake Configuration
# ==============================================================================
set(CMAKE_C_COMPILER "${GCC}" CACHE STRING "C compiler")
set(CMAKE_CXX_COMPILER "${GXX}" CACHE STRING "C++ compiler")
set(CMAKE_LINKER "${LD}" CACHE STRING "Linker")
set(CMAKE_OBJDUMP "${OBJDUMP}" CACHE STRING "Objdump")
set(CMAKE_OBJCOPY "${OBJCOPY}" CACHE STRING "Objcopy")
set(CMAKE_SIZE "${SIZE}" CACHE STRING "Size")
set(CMAKE_AR "${AR}" CACHE STRING "Archiver")
set(MAKE make CACHE STRING "Make")
set(MKDIR mkdir CACHE STRING "Mkdir")
set(RM rm CACHE STRING "Rm")
set(CMAKE_C_FLAGS "-Wall -Werror -std=c11 ${CPUCONFIG_CFLAGS}")
set(CMAKE_CXX_FLAGS "-Wall -Werror -std=c++17 ${CPUCONFIG_CXXFLAGS}")
set(CMAKE_LFLAGS "${CPUCONFIG_LDFLAGS}")
2 changes: 1 addition & 1 deletion tools/system/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ add_subdirectory(todmfc)
add_subdirectory(todmp)
add_subdirectory(todmd)
add_subdirectory(todmm)
add_subdirectory(dmf-get)
#add_subdirectory(dmf-get)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WTF?!?!?!?!?!

add_subdirectory(dmf-man)
add_subdirectory(whereisdmf)
add_subdirectory(mkdmrpkg)