fix #123. add another build option 'USE_C11_FEATURE'
This commit is contained in:
parent
5daddc931e
commit
2f75715c84
|
@ -16,8 +16,16 @@ execute_process(
|
|||
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY bin)
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY lib)
|
||||
set(CMAKE_C_FLAGS "-Wall -Wextra -std=c99")
|
||||
set(CMAKE_C_FLAGS "-Wall -Wextra")
|
||||
set(CMAKE_C_FLAGS_DEBUG "-g -DDEBUG=1")
|
||||
|
||||
option(USE_C11_FEATURE "Enable c11 feature" OFF)
|
||||
if(USE_C11_FEATURE)
|
||||
add_definitions(-std=c11)
|
||||
else()
|
||||
add_definitions(-std=c99) # at least c99 is required
|
||||
endif()
|
||||
|
||||
include_directories(include extlib)
|
||||
|
||||
# build picrin
|
||||
|
|
|
@ -35,12 +35,12 @@ There is a chat room on chat.freenode.org, channel #picrin.
|
|||
|
||||
- make `Makefile`
|
||||
|
||||
Change directory to `build` then run `cmake` to create Makefile. Once `Makefile` is generated you can run `make` command to build picrin.
|
||||
Change directory to `build` then run `ccmake` to create Makefile. Once `Makefile` is generated you can run `make` command to build picrin.
|
||||
|
||||
$ cd build
|
||||
$ cmake ..
|
||||
$ ccmake ..
|
||||
|
||||
Actually you don't necessarily need to move to `build` directory before running `cmake` (in that case `$ cmake .`), but I strongly recommend to follow above instruction.
|
||||
Actually you don't necessarily need to move to `build` directory before running `ccmake` (in that case `$ ccmake .`), but I strongly recommend to follow above instruction.
|
||||
|
||||
- build
|
||||
|
||||
|
|
|
@ -21,13 +21,13 @@ Installation
|
|||
|
||||
- make `Makefile`
|
||||
|
||||
Change directory to `build` then run `cmake` to create Makefile. Once `Makefile` is generated you can run `make` command to build picrin::
|
||||
Change directory to `build` then run `ccmake` to create Makefile. Once `Makefile` is generated you can run `make` command to build picrin::
|
||||
|
||||
$ cd build
|
||||
|
||||
$ cmake ..
|
||||
$ ccmake ..
|
||||
|
||||
Actually you don't necessarily need to move to `build` directory before running `cmake` (in that case `$ cmake .`), but I strongly recommend to follow above instruction.
|
||||
Actually you don't necessarily need to move to `build` directory before running `ccmake` (in that case `$ ccmake .`), but I strongly recommend to follow above instruction.
|
||||
|
||||
- build
|
||||
|
||||
|
|
|
@ -45,6 +45,10 @@
|
|||
/* #define GC_DEBUG 1 */
|
||||
/* #define GC_DEBUG_DETAIL 1 */
|
||||
|
||||
#if __STDC_VERSION__ < 199901L
|
||||
# error please activate c99 features
|
||||
#endif
|
||||
|
||||
#ifndef PIC_CONTRIB_INITS
|
||||
# define PIC_CONTRIB_INITS
|
||||
#endif
|
||||
|
@ -56,7 +60,7 @@
|
|||
#endif
|
||||
|
||||
#ifndef PIC_NAN_BOXING
|
||||
# if __x86_64__
|
||||
# if __x86_64__ && __STDC_VERSION__ >= 201112L
|
||||
# define PIC_NAN_BOXING 1
|
||||
# endif
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue