Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bison calls in Windows #70

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
36 changes: 22 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,17 @@ if (WIN32)
EXEC_PROGRAM(${CMAKE_COMMAND} ARGS "-E write_regv \"${hkey}\" \"${dir}\"")
endif ()


set(MACHINE_INDEPENDENT_GENERATED_SOURCE_FILES
${CMAKE_CURRENT_SOURCE_DIR}/hlslang/MachineIndependent/Gen_hlslang.cpp
${CMAKE_CURRENT_SOURCE_DIR}/hlslang/MachineIndependent/hlslang_tab.cpp
${CMAKE_CURRENT_SOURCE_DIR}/hlslang/MachineIndependent/hlslang_tab.h
)
if (WIN32 OR APPLE)
set(MACHINE_INDEPENDENT_GENERATED_SOURCE_FILES
${CMAKE_CURRENT_SOURCE_DIR}/hlslang/MachineIndependent/Gen_hlslang.cpp
${CMAKE_CURRENT_SOURCE_DIR}/hlslang/MachineIndependent/hlslang_tab.h
)
else()
set(MACHINE_INDEPENDENT_GENERATED_SOURCE_FILES
${CMAKE_CURRENT_SOURCE_DIR}/hlslang/MachineIndependent/hlslang_tab.cpp
${CMAKE_CURRENT_SOURCE_DIR}/hlslang/MachineIndependent/hlslang_tab.h
)
endif()

SET_SOURCE_FILES_PROPERTIES(${MACHINE_INDEPENDENT_GENERATED_SOURCE_FILES} PROPERTIES
GENERATED 1
Expand All @@ -107,27 +112,30 @@ source_group("Machine Independent\\Generated Source" FILES ${MACHINE_INDEPENDENT
# Add system specific settings
if (WIN32)
set(OSDEPENDENT_FILES
hlslang/OSDependent/Windows/main.cpp
hlslang/OSDependent/Windows/unistd.h
hlslang/OSDependent/Windows/osinclude.h
hlslang/OSDependent/Windows/ossource.cpp
)
source_group("OSDependent\\Windows" FILES ${OSDEPENDENT_FILES})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/hlslang/OSDependent/Windows)

add_custom_command(OUTPUT hlslang/MachineIndependent/Gen_hlslang_tab.cpp hlslang/MachineIndependent/hlslang_tab.h
COMMAND set ARGS "BISON_SIMPLE=../../tools/bison.simple"
COMMAND set ARGS "BISON_HAIRY=../../tools/bison.simple"
COMMAND ../../tools/bison.exe ARGS -d -t -v hlslang.y
COMMAND copy ARGS /y hlslang_tab.c Gen_hlslang_tab.cpp
COMMAND del ARGS hlslang_tab.c
add_custom_command(OUTPUT hlslang/MachineIndependent/Gen_hlslang_tab.cpp hlslang/MachineIndependent/hlslang.tab.h
COMMAND set ARGS "PATH=%PATH%;${CMAKE_CURRENT_SOURCE_DIR}/tools/bin/"
COMMAND set ARGS "BISON_SIMPLE=${CMAKE_CURRENT_SOURCE_DIR}/tools/bin/bison.simple"
COMMAND set ARGS "BISON_HAIRY=${CMAKE_CURRENT_SOURCE_DIR}/tools/bin/bison.simple"
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/tools/bin/bison.exe ARGS -d -t -v hlslang.y
COMMAND copy ARGS /y hlslang.tab.c Gen_hlslang_tab.cpp
COMMAND del ARGS hlslang.tab.c
COMMAND copy ARGS /y hlslang.tab.h hlslang_tab.h
COMMAND del ARGS hlslang.tab.h
COMMAND del ARGS hlslang.output
MAIN_DEPENDENCY hlslang/MachineIndependent/hlslang.y
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/hlslang/MachineIndependent
COMMENT "Executing Bison on hlslang.y"
)

add_custom_command(OUTPUT hlslang/MachineIndependent/Gen_hlslang.cpp
COMMAND ../../tools/flex.exe ARGS hlslang.l
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/tools/flex.exe ARGS hlslang.l
MAIN_DEPENDENCY hlslang/MachineIndependent/hlslang.l
DEPENDS hlslang/MachineIndependent/hlslang_tab.h
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/hlslang/MachineIndependent
Expand Down
1 change: 1 addition & 0 deletions hlslang/MachineIndependent/Intermediate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "ParseHelper.h"
#include <float.h>
#include <limits.h>
#include <algorithm>

static TPrecision GetHigherPrecision (TPrecision left, TPrecision right) {
return left > right ? left : right;
Expand Down