Skip to content

Commit

Permalink
More fixes for Windows build.
Browse files Browse the repository at this point in the history
  • Loading branch information
elliottslaughter committed Sep 24, 2019
1 parent aa3f0dc commit 517ef5a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
2 changes: 1 addition & 1 deletion appveyor.yml
Expand Up @@ -49,7 +49,7 @@ install:

build_script:
- cd build
- cmake .. -DCMAKE_INSTALL_PREFIX=%CD%\..\install -DTERRA_SLIB_INCLUDE_LLVM=OFF -DTERRA_SLIB_INCLUDE_LUAJIT=OFF
- cmake .. -DCMAKE_INSTALL_PREFIX=%CD%\..\install -DTERRA_SLIB_INCLUDE_LLVM=OFF -DTERRA_SLIB_INCLUDE_LUAJIT=OFF -DCMAKE_GENERATOR_PLATFORM=x64
- cmake --build . --target INSTALL
- cd ..
# # There is probably a better way to do this...
Expand Down
21 changes: 20 additions & 1 deletion src/CMakeLists.txt
Expand Up @@ -256,9 +256,21 @@ endif()

list(APPEND TERRA_EXE_SRC
main.cpp
linenoise.cpp linenoise.h
)

if(WIN32)
list(APPEND TERRA_EXE_SRC
${PROJECT_SOURCE_DIR}/msvc/ext/getopt.c ${PROJECT_SOURCE_DIR}/msvc/ext/getopt.h
${PROJECT_SOURCE_DIR}/msvc/ext/getopt_long.c
${PROJECT_SOURCE_DIR}/msvc/ext/inttypes.h
${PROJECT_SOURCE_DIR}/msvc/ext/setjmp.h
)
else()
list(APPEND TERRA_EXE_SRC
linenoise.cpp linenoise.h
)
endif()

add_executable(TerraExecutable ${TERRA_EXE_SRC})

set_target_properties(TerraExecutable PROPERTIES OUTPUT_NAME terra)
Expand All @@ -270,6 +282,13 @@ target_include_directories(TerraExecutable
${PROJECT_BINARY_DIR}/include/terra
)

if(WIN32)
target_include_directories(TerraExecutable
PRIVATE
${PROJECT_SOURCE_DIR}/msvc
)
endif()

target_compile_definitions(TerraExecutable
PRIVATE
${TERRA_VERSION_DEFINITIONS}
Expand Down

0 comments on commit 517ef5a

Please sign in to comment.