mirror of https://github.com/rusefi/openblt.git
Refs #424. Added -std=gnu99 flag to CMakeLists.txt files when building with GCC under Windows.
git-svn-id: https://svn.code.sf.net/p/openblt/code/trunk@380 5dc33758-31d5-4daf-9ae8-b24bf3d40d73
This commit is contained in:
parent
88855a5f7a
commit
a16099de24
Binary file not shown.
|
@ -75,7 +75,11 @@ set(LIBOPENBLT_LIB ${PROJECT_OUTPUT_DIRECTORY})
|
|||
#****************************************************************************************
|
||||
# Set platform specific compiler macro PLATFORM_XXX
|
||||
if(WIN32)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DPLATFORM_WIN32 -D_CRT_SECURE_NO_WARNINGS")
|
||||
if(CMAKE_C_COMPILER_ID MATCHES GNU)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DPLATFORM_WIN32 -D_CRT_SECURE_NO_WARNINGS -std=gnu99")
|
||||
elseif(CMAKE_C_COMPILER_ID MATCHES MSVC)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DPLATFORM_WIN32 -D_CRT_SECURE_NO_WARNINGS")
|
||||
endif()
|
||||
elseif(UNIX)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DPLATFORM_LINUX -pthread -std=gnu99")
|
||||
endif(WIN32)
|
||||
|
|
|
@ -63,10 +63,8 @@ option(LINT_ENABLED "Configurable to enable/disable the PC-lint target" OFF)
|
|||
# Set the port directory, which is platform specific
|
||||
if(WIN32)
|
||||
set(PROJECT_PORT_DIR ${PROJECT_SOURCE_DIR}/port/windows)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DPLATFORM_WIN32 -D_CRT_SECURE_NO_WARNINGS")
|
||||
elseif(UNIX)
|
||||
set(PROJECT_PORT_DIR ${PROJECT_SOURCE_DIR}/port/linux)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DPLATFORM_LINUX -pthread -std=gnu99")
|
||||
endif(WIN32)
|
||||
|
||||
# Set the output directory
|
||||
|
@ -84,6 +82,20 @@ foreach( OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES} )
|
|||
set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${PROJECT_OUTPUT_DIRECTORY} )
|
||||
endforeach( OUTPUTCONFIG CMAKE_CONFIGURATION_TYPES )
|
||||
|
||||
#****************************************************************************************
|
||||
# Compiler flags
|
||||
#****************************************************************************************
|
||||
# Set platform specific compiler macro PLATFORM_XXX
|
||||
if(WIN32)
|
||||
if(CMAKE_C_COMPILER_ID MATCHES GNU)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DPLATFORM_WIN32 -D_CRT_SECURE_NO_WARNINGS -std=gnu99")
|
||||
elseif(CMAKE_C_COMPILER_ID MATCHES MSVC)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DPLATFORM_WIN32 -D_CRT_SECURE_NO_WARNINGS")
|
||||
endif()
|
||||
elseif(UNIX)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DPLATFORM_LINUX -pthread -std=gnu99")
|
||||
endif(WIN32)
|
||||
|
||||
|
||||
#***************************************************************************************
|
||||
# Includes
|
||||
|
|
|
@ -245,7 +245,7 @@ static bool CanUsbConnect(void)
|
|||
result = true;
|
||||
/* Set the reception callback function. */
|
||||
if (CanUsbLibFuncSetReceiveCallBack(canUsbCanHandle,
|
||||
CanUsbLibReceiveCallback) <= 0)
|
||||
(LPFNDLL_RECEIVE_CALLBACK)CanUsbLibReceiveCallback) <= 0)
|
||||
{
|
||||
result = false;
|
||||
}
|
||||
|
|
|
@ -71,9 +71,13 @@ endforeach( OUTPUTCONFIG CMAKE_CONFIGURATION_TYPES )
|
|||
#****************************************************************************************
|
||||
# Set platform specific compiler macro PLATFORM_XXX
|
||||
if(WIN32)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DPLATFORM_WIN32 -D_CRT_SECURE_NO_WARNINGS")
|
||||
if(CMAKE_C_COMPILER_ID MATCHES GNU)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DPLATFORM_WIN32 -D_CRT_SECURE_NO_WARNINGS -std=gnu99")
|
||||
elseif(CMAKE_C_COMPILER_ID MATCHES MSVC)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DPLATFORM_WIN32 -D_CRT_SECURE_NO_WARNINGS")
|
||||
endif()
|
||||
elseif(UNIX)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DPLATFORM_LINUX -std=gnu99")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DPLATFORM_LINUX -pthread -std=gnu99")
|
||||
endif(WIN32)
|
||||
|
||||
|
||||
|
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue